19 int64_t init_capacity,
20 const Dtype& key_dtype,
22 const std::vector<Dtype>& value_dtypes,
23 const std::vector<SizeVector>& value_element_shapes,
28 value_dtypes, value_element_shapes, device,
31 #if defined(BUILD_CUDA_MODULE)
32 else if (device.
IsCUDA()) {
34 key_element_shape, value_dtypes,
35 value_element_shapes, device, backend);
bool IsCUDA() const
Returns true iff device type is CUDA.
bool IsCPU() const
Returns true iff device type is CPU.
Helper functions for the ml ops.
std::shared_ptr< DeviceHashBackend > CreateCPUHashBackend(int64_t init_capacity, const Dtype &key_dtype, const SizeVector &key_element_shape, const std::vector< Dtype > &value_dtypes, const std::vector< SizeVector > &value_element_shapes, const Device &device, const HashBackendType &backend)
Non-templated factory.
std::shared_ptr< DeviceHashBackend > CreateDeviceHashBackend(int64_t init_capacity, const Dtype &key_dtype, const SizeVector &key_element_shape, const std::vector< Dtype > &value_dtypes, const std::vector< SizeVector > &value_element_shapes, const Device &device, const HashBackendType &backend)
std::shared_ptr< DeviceHashBackend > CreateCUDAHashBackend(int64_t init_capacity, const Dtype &key_dtype, const SizeVector &key_element_shape, const std::vector< Dtype > &value_dtypes, const std::vector< SizeVector > &value_element_shapes, const Device &device, const HashBackendType &backend)
Generic file read and write utility for python interface.