Resources used by mxnet operations. A resource is something special other than NDArray, but will still participate.
More...
#include <resource.h>
|
| Resource () |
| default constructor More...
|
|
template<typename xpu , typename DType > |
mshadow::Random< xpu, DType > * | get_random (mshadow::Stream< xpu > *stream) const |
| Get random number generator. More...
|
|
template<typename xpu , int ndim> |
mshadow::Tensor< xpu, ndim, real_t > | get_space (mshadow::Shape< ndim > shape, mshadow::Stream< xpu > *stream) const |
| Get space requested as mshadow Tensor. The caller can request arbitrary size. More...
|
|
template<int ndim> |
mshadow::Tensor< cpu, ndim, real_t > | get_host_space (mshadow::Shape< ndim > shape) const |
| Get cpu space requested as mshadow Tensor. The caller can request arbitrary size. More...
|
|
template<typename xpu , int ndim, typename DType > |
mshadow::Tensor< xpu, ndim, DType > | get_space_typed (mshadow::Shape< ndim > shape, mshadow::Stream< xpu > *stream) const |
| Get space requested as mshadow Tensor in specified type. The caller can request arbitrary size. More...
|
|
template<int ndim, typename DType > |
mshadow::Tensor< cpu, ndim, DType > | get_host_space_typed (mshadow::Shape< ndim > shape) const |
| Get CPU space as mshadow Tensor in specified type. The caller can request arbitrary size. More...
|
|
void * | get_space_internal (size_t size) const |
| internal function to get space from resources. More...
|
|
void * | get_host_space_internal (size_t size) const |
| internal function to get cpu space from resources. More...
|
|
Resources used by mxnet operations. A resource is something special other than NDArray, but will still participate.
mxnet::Resource::Resource |
( |
| ) |
|
|
inline |
template<int ndim>
mshadow::Tensor<cpu, ndim, real_t> mxnet::Resource::get_host_space |
( |
mshadow::Shape< ndim > |
shape | ) |
const |
|
inline |
Get cpu space requested as mshadow Tensor. The caller can request arbitrary size.
- Parameters
-
shape | the Shape of returning tensor. |
- Returns
- the mshadow tensor requested.
- Template Parameters
-
ndim | the number of dimension of the tensor requested. |
void* mxnet::Resource::get_host_space_internal |
( |
size_t |
size | ) |
const |
internal function to get cpu space from resources.
- Parameters
-
- Returns
- The allocated space
template<int ndim, typename DType >
mshadow::Tensor<cpu, ndim, DType> mxnet::Resource::get_host_space_typed |
( |
mshadow::Shape< ndim > |
shape | ) |
const |
|
inline |
Get CPU space as mshadow Tensor in specified type. The caller can request arbitrary size.
- Parameters
-
shape | the Shape of returning tensor |
- Returns
- the mshadow tensor requested
- Template Parameters
-
ndim | the number of dimnesion of tensor requested |
DType | request data type |
template<typename xpu , typename DType >
mshadow::Random<xpu, DType>* mxnet::Resource::get_random |
( |
mshadow::Stream< xpu > * |
stream | ) |
const |
|
inline |
Get random number generator.
- Parameters
-
stream | The stream to use in the random number generator. |
- Returns
- the mshadow random number generator requested.
- Template Parameters
-
xpu | the device type of random number generator. |
template<typename xpu , int ndim>
mshadow::Tensor<xpu, ndim, real_t> mxnet::Resource::get_space |
( |
mshadow::Shape< ndim > |
shape, |
|
|
mshadow::Stream< xpu > * |
stream |
|
) |
| const |
|
inline |
Get space requested as mshadow Tensor. The caller can request arbitrary size.
This space can be shared with other calls to this->get_space. So the caller need to serialize the calls when using the conflicted space. The old space can get freed, however, this will incur a synchronization, when running on device, so the launched kernels that depend on the temp space can finish correctly.
- Parameters
-
shape | the Shape of returning tensor. |
stream | the stream of retruning tensor. |
- Returns
- the mshadow tensor requested.
- Template Parameters
-
xpu | the device type of random number generator. |
ndim | the number of dimension of the tensor requested. |
void* mxnet::Resource::get_space_internal |
( |
size_t |
size | ) |
const |
internal function to get space from resources.
- Parameters
-
size | The size of the space. |
- Returns
- The allocated space.
template<typename xpu , int ndim, typename DType >
mshadow::Tensor<xpu, ndim, DType> mxnet::Resource::get_space_typed |
( |
mshadow::Shape< ndim > |
shape, |
|
|
mshadow::Stream< xpu > * |
stream |
|
) |
| const |
|
inline |
Get space requested as mshadow Tensor in specified type. The caller can request arbitrary size.
- Parameters
-
shape | the Shape of returning tensor. |
stream | the stream of retruning tensor. |
- Returns
- the mshadow tensor requested.
- Template Parameters
-
xpu | the device type of random number generator. |
ndim | the number of dimension of the tensor requested. |
int32_t mxnet::Resource::id |
identifier of id information, used for debug purpose
void* mxnet::Resource::ptr_ |
pointer to the resource, do not use directly, access using member functions
The documentation for this struct was generated from the following file: