20 template <
typename func_t>
25 func(indexer.GetInputPtr(i), indexer.GetOutputPtr(i));
29 template <
typename scalar_t>
31 *
static_cast<scalar_t*
>(dst) = *
static_cast<const scalar_t*
>(src);
36 int64_t object_byte_size) {
37 const char* src_bytes =
static_cast<const char*
>(src);
38 char* dst_bytes =
static_cast<char*
>(dst);
39 memcpy(dst_bytes, src_bytes, object_byte_size);
44 const std::vector<Tensor>& index_tensors,
48 AdvancedIndexer ai(src, dst, index_tensors, indexed_shape, indexed_strides,
51 int64_t object_byte_size = dtype.
ByteSize();
64 const std::vector<Tensor>& index_tensors,
68 AdvancedIndexer ai(src, dst, index_tensors, indexed_shape, indexed_strides,
71 int64_t object_byte_size = dtype.
ByteSize();
#define DISPATCH_DTYPE_TO_TEMPLATE_WITH_BOOL(DTYPE,...)
static void LaunchAdvancedIndexerKernel(const AdvancedIndexer &indexer, const func_t &func)
void IndexGetCPU(const Tensor &src, Tensor &dst, const std::vector< Tensor > &index_tensors, const SizeVector &indexed_shape, const SizeVector &indexed_strides)
void IndexSetCPU(const Tensor &src, Tensor &dst, const std::vector< Tensor > &index_tensors, const SizeVector &indexed_shape, const SizeVector &indexed_strides)
static void CPUCopyElementKernel(const void *src, void *dst)
static void CPUCopyObjectElementKernel(const void *src, void *dst, int64_t object_byte_size)
void ParallelFor(const Device &device, int64_t n, const func_t &func)
Generic file read and write utility for python interface.