mxnet
|
Tensor data structure used by custom operator. More...
#include <lib_api.h>
Public Member Functions | |
MXTensor () | |
MXTensor (const MXTensor &oth) | |
MXTensor (void *data_ptr, std::vector< int64_t > shape, MXDType dtype, size_t vID, MXContext mx_ctx, MXStorageType stype=kDefaultStorage) | |
void | setTensor (void *dptr, MXDType type, const int64_t *dims, int ndims, size_t vID, MXContext mx_ctx, MXStorageType storage_type) |
populate internal tensor fields More... | |
void | setDLTensor () |
populate DLTensor fields More... | |
template<typename data_type > | |
data_type * | data () |
helper function to cast data pointer More... | |
int64_t | size () const |
helper function to get data size More... | |
bool | isSame (const MXTensor &oth) const |
helper function to compare two MXTensors More... | |
Public Attributes | |
void * | data_ptr |
std::vector< int64_t > | shape |
MXDType | dtype |
size_t | verID |
MXContext | ctx |
DLTensor | dltensor |
MXStorageType | stype |
Tensor data structure used by custom operator.
mxnet::ext::MXTensor::MXTensor | ( | ) |
mxnet::ext::MXTensor::MXTensor | ( | const MXTensor & | oth | ) |
mxnet::ext::MXTensor::MXTensor | ( | void * | data_ptr, |
std::vector< int64_t > | shape, | ||
MXDType | dtype, | ||
size_t | vID, | ||
MXContext | mx_ctx, | ||
MXStorageType | stype = kDefaultStorage |
||
) |
|
inline |
helper function to cast data pointer
bool mxnet::ext::MXTensor::isSame | ( | const MXTensor & | oth | ) | const |
helper function to compare two MXTensors
void mxnet::ext::MXTensor::setDLTensor | ( | ) |
populate DLTensor fields
void mxnet::ext::MXTensor::setTensor | ( | void * | dptr, |
MXDType | type, | ||
const int64_t * | dims, | ||
int | ndims, | ||
size_t | vID, | ||
MXContext | mx_ctx, | ||
MXStorageType | storage_type | ||
) |
populate internal tensor fields
int64_t mxnet::ext::MXTensor::size | ( | ) | const |
helper function to get data size
MXContext mxnet::ext::MXTensor::ctx |
void* mxnet::ext::MXTensor::data_ptr |
DLTensor mxnet::ext::MXTensor::dltensor |
MXDType mxnet::ext::MXTensor::dtype |
std::vector<int64_t> mxnet::ext::MXTensor::shape |
MXStorageType mxnet::ext::MXTensor::stype |
size_t mxnet::ext::MXTensor::verID |