|
| NDArray () |
| default constructor More...
|
|
| NDArray (const mxnet::TShape &shape, Context ctx, bool delay_alloc=false, int dtype=mshadow::default_type_flag) |
| constructs a new dynamic NDArray More...
|
|
| NDArray (const NDArrayStorageType stype, const mxnet::TShape &shape, Context ctx, bool delay_alloc=true, int dtype=mshadow::default_type_flag, std::vector< int > aux_types={}, mxnet::ShapeVector aux_shapes={}, mxnet::TShape storage_shape=mxnet::TShape(mshadow::Shape1(0))) |
| constructor for NDArray with storage type More...
|
|
| NDArray (Context ctx, int dtype=mshadow::default_type_flag) |
| constructs a new dynamic NDArray whose shape is unknown, hence the NDArray is inherently lazily created More...
|
|
| NDArray (const TBlob &data, int dev_id) |
| constructing a static NDArray that shares data with TBlob Use with caution: allocate ONLY ONE NDArray for each TBlob, make sure the memory region is available through out the life of NDArray More...
|
|
| NDArray (const TBlob &data, int dev_id, const std::function< void()> &deleter) |
| constructing a static NDArray that shares data with TBlob which is with deleter Use with caution: allocate ONLY ONE NDArray for each TBlob, make sure the memory region is available through out the life of NDArray More...
|
|
| NDArray (int shared_pid, int shared_id, const mxnet::TShape &shape, int dtype) |
| create ndarray from shared memory More...
|
|
| NDArray (const NDArrayStorageType stype, const mxnet::TShape &shape, const TBlob &data, const std::vector< TBlob > &aux_data, int dev_id) |
| constructing a static NDArray of non-default storage that shares data with TBlob Use with caution: allocate ONLY ONE NDArray for each TBlob, make sure the memory region is available through out the life of NDArray More...
|
|
void | Init (const mxnet::TShape &shape) |
| initialize the NDArray, assuming it is not assigned a meaningful shape before More...
|
|
void | SetShapeFromChunk () |
| set the correct shape of NDArray directly from the storage_shape of its own chunk. More...
|
|
bool | IsView () const |
|
bool | IsSame (const NDArray &other) const |
|
const mxnet::TShape & | shape () const |
|
const mxnet::TShape & | storage_shape () const |
|
const mxnet::TShape & | aux_shape (size_t index) const |
| get the shape of aux_data(index) More...
|
|
const mxnet::ShapeVector & | aux_shapes () const |
|
const std::vector< int > & | aux_types () const |
|
void | set_aux_shape (size_t index, const mxnet::TShape &shape) const |
| For a sparse operation on a csr matrix for example, the size of the column index array is an estimated value in the beginning for allocating enough capacity for the final result. After the operation is done, the exact size of the shape is known and need to be reset using this function. More...
|
|
const TBlob & | data () const |
|
NDArray | grad () const |
|
TBlob | aux_data (size_t i) const |
|
Context | ctx () const |
|
int | dtype () const |
|
int | aux_type (size_t i) const |
|
NDArrayStorageType | storage_type () const |
|
bool | is_none () const |
|
bool | fresh_out_grad () const |
|
void | set_fresh_out_grad (bool state) const |
|
bool | storage_initialized () const |
| Returns true if a sparse ndarray's aux_data and storage are initialized Throws an exception if the indices array shape is inconsistent Returns false if the indices array is empty(nnz = 0) for csr/row_sparse. More...
|
|
Storage::Handle | storage_handle () const |
| get storage handle More...
|
|
void | WaitToRead () const |
| Block until all the pending write operations with respect to current NDArray are finished, and read can be performed. More...
|
|
void | WaitToWrite () const |
| Block until all the pending read/write operations with respect to current NDArray are finished, and write can be performed. More...
|
|
Engine::VarHandle | var () const |
|
size_t | byte_offset () const |
|
size_t | version () const |
| return var version of the NDArray More...
|
|
void | Save (dmlc::Stream *strm) const |
| save the content into binary stream More...
|
|
bool | LegacyLoad (dmlc::Stream *strm, const uint32_t magic) |
| load ndarrays before supporting sparse ndarrays More...
|
|
bool | Load (dmlc::Stream *strm) |
| load the content from binary stream More...
|
|
NDArray & | operator= (real_t scalar) |
| set all the elements in ndarray to be scalar More...
|
|
NDArray & | operator+= (const NDArray &src) |
| elementwise add to current space this mutate the current NDArray More...
|
|
NDArray & | operator+= (const real_t &src) |
| elementwise add to current space this mutate the current NDArray More...
|
|
NDArray & | operator-= (const NDArray &src) |
| elementwise subtract from current ndarray this mutate the current NDArray More...
|
|
NDArray & | operator-= (const real_t &src) |
| elementwise subtract from current ndarray this mutate the current NDArray More...
|
|
NDArray & | operator*= (const NDArray &src) |
| elementwise multiplication to current ndarray this mutate the current NDArray More...
|
|
NDArray & | operator*= (const real_t &src) |
| elementwise multiplication to current ndarray this mutate the current NDArray More...
|
|
NDArray & | operator/= (const NDArray &src) |
| elementwise division from current ndarray this mutate the current NDArray More...
|
|
NDArray & | operator/= (const real_t &src) |
| elementwise division from current ndarray this mutate the current NDArray More...
|
|
NDArray | Copy (Context ctx) const |
| return a new copy this NDArray More...
|
|
void | SyncCopyFromCPU (const void *data, size_t size) const |
| Do a synchronize copy from a continugous CPU memory region. More...
|
|
void | SyncCopyFromNDArray (const NDArray &src, int i=-1, int j=-1) |
| Copy from src.data()/aux_data(i) to this->data()/aux_data(j) More...
|
|
void | SyncCopyToCPU (void *data, size_t size) const |
| Do a synchronize copy to a continugous CPU memory region. More...
|
|
void | SyncCheckFormat (const bool full_check) const |
| check whether the NDArray format is valid More...
|
|
NDArray | Slice (index_t begin, index_t end) const |
| Slice a NDArray. More...
|
|
NDArray | SliceWithRecord (index_t begin, index_t end) |
| Slice a NDArray. Supports recording with autograd. More...
|
|
NDArray | At (index_t idx) const |
| Index a NDArray. More...
|
|
NDArray | AtWithRecord (index_t idx) |
| Index a NDArray. More...
|
|
NDArray | aux_ndarray (size_t i) const |
| Generate a deep copy of aux_data(i) returned as a default storage type NDArray. More...
|
|
NDArray | data_ndarray () const |
| Generate a deep copy of data() returned as a default storage type NDArray. More...
|
|
NDArray | AsArray (const mxnet::TShape &shape, int dtype) const |
| Create a NDArray that shares memory with current one The new array must have smaller memory size than the current array. More...
|
|
DLManagedTensor * | ToDLPack () const |
| Create a reference view of NDArray that represents as DLManagedTensor. More...
|
|
void | SparseUpdateChunk (const NDArray &arr) const |
| Update ndarray chunk storage handles using existing ndarray storage handles Also update the aux_handle, aux_shapes and aux_types. This is specifically used for custom op to update the inputs and outputs from the temporary ndarray which stores intermediate custom op results. Should be used with caution elsewhere. Supports only CSR and RSP formats. More...
|
|
NDArray | Reshape (const mxnet::TShape &shape) const |
| Get an reshaped NDArray. More...
|
|
NDArray | ReshapeWithRecord (const mxnet::TShape &shape) |
| Get an reshaped NDArray. Supports autograd recording. More...
|
|
NDArray | Detach () const |
| Return a copy of this NDArray without autograd history. More...
|
|
nnvm::Symbol | get_autograd_symbol () const |
|
void | CheckAndAlloc () const |
| Allocate the space if it is delayed allocated. This is an internal function used by system that normal user should not use. More...
|
|
void | ReshapeAndAlloc (const mxnet::TShape &shape) |
| Allocate the space if the allocation has been delayed or the requested size is bigger than the available one. This function can only be called by ndarray of default storage type and effectively changes the ndarray's shape_. Note: This function is named as this to avoid overload conflict with CheckAndAlloc(const mxnet::ShapeVector &aux_shapes), since mxnet::TShape tmp = some_shape is equivalent to mxnet::TShape tmp = {some_shape}. More...
|
|
void | CheckAndAlloc (const mxnet::ShapeVector &aux_shapes) const |
|
void | CheckAndAllocData (const mxnet::TShape &storage_shape) const |
|
void | CheckAndAllocAuxData (size_t i, const mxnet::TShape &aux_shape) const |
|