|
| NDArray () |
| default constructor More...
|
|
| NDArray (const 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 TShape &shape, Context ctx, bool delay_alloc=true, int dtype=mshadow::default_type_flag, std::vector< int > aux_types={}, std::vector< TShape > aux_shapes={}, TShape storage_shape=TShape(mshadow::Shape1(0))) |
| constructor for NDArray with storage type 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 (int shared_pid, int shared_id, const TShape &shape, int dtype) |
| create ndarray from shared memory More...
|
|
| NDArray (const NDArrayStorageType stype, const 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...
|
|
const TShape & | shape () const |
|
const TShape & | storage_shape () const |
|
const TShape & | aux_shape (size_t index) const |
| get the shape of aux_data(index) More...
|
|
const std::vector< TShape > & | aux_shapes () const |
|
const std::vector< int > & | aux_types () const |
|
void | set_aux_shape (size_t index, const 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 |
|
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 |
|
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 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...
|
|
NDArray | Reshape (const TShape &shape) const |
| Get an reshaped NDArray. More...
|
|
NDArray | ReshapeWithRecord (const 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 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 std::vector<TShape> &aux_shapes), since TShape tmp = some_shape is equivalent to TShape tmp = {some_shape}. More...
|
|
void | CheckAndAlloc (const std::vector< TShape > &aux_shapes) const |
|
void | CheckAndAllocData (const TShape &storage_shape) const |
|
void | CheckAndAllocAuxData (size_t i, const TShape &aux_shape) const |
|