mxnet
Namespaces | Classes | Typedefs | Functions
mxnet::common Namespace Reference

Namespaces

 cuda
 common utils for cuda
 
 helper
 Helper functions.
 
 random
 

Classes

struct  csr_idx_check
 Indices should be non-negative, less than the number of columns and in ascending order per row. More...
 
struct  csr_indptr_check
 IndPtr should be non-negative, in non-decreasing order, start with 0 and end with value equal with size of indices. More...
 
struct  deserialize_tuple
 
struct  deserialize_tuple< 0 >
 
struct  is_container
 
class  LazyAllocArray
 
class  ObjectPool
 Object pool for fast allocation and deallocation. More...
 
struct  ObjectPoolAllocatable
 Helper trait class for easy allocation and deallocation. More...
 
struct  rsp_idx_check
 Indices of RSPNDArray should be non-negative, less than the size of first dimension and in ascending order. More...
 
struct  serialize_tuple
 
struct  serialize_tuple< 0 >
 
struct  serialized_size_tuple
 
struct  serialized_size_tuple< 0 >
 
struct  StaticArray
 Static array. This code is borrowed from struct Shape<ndim>, except that users can specify the type of the elements of the statically allocated array. The object instance of the struct is copyable between CPU and GPU. More...
 

Typedefs

typedef std::mt19937 RANDOM_ENGINE
 Random Engine. More...
 

Functions

bool SetupDefaultBlobsIn (const std::vector< NDArray > &src, const std::vector< NDArray > *bufs, std::vector< TBlob > *blobs, std::vector< NDArray > *temp_src, std::vector< NDArray > *temp_dst, std::unordered_map< uint32_t, uint32_t > *idx_map)
 
bool SetupDefaultBlobsOut (const std::vector< NDArray > &src, const std::vector< NDArray > *bufs, std::vector< OpReqType > *req, std::vector< TBlob > *blobs, std::vector< NDArray > *temp_src, std::vector< NDArray > *temp_dst)
 
void SetupDefaultBlobsInOut (const std::vector< NDArray > &ndinputs, const std::vector< NDArray > &ndoutputs, const std::vector< NDArray > *in_bufs, const std::vector< NDArray > *out_bufs, std::vector< OpReqType > *req, std::vector< TBlob > *input_blobs, std::vector< TBlob > *output_blobs, std::vector< NDArray > *pre_temp_src, std::vector< NDArray > *pre_temp_dst, std::vector< NDArray > *post_temp_src, std::vector< NDArray > *post_temp_dst, std::unordered_map< uint32_t, uint32_t > *in_temp_idx_map, const std::vector< uint32_t > &mutate_idx)
 
void CastNonDefaultStorage (const std::vector< NDArray > &src, const std::vector< NDArray > &dst, const OpContext &ctx, const bool is_gpu)
 
bool SameType (const nnvm::NodeAttrs &attrs, std::vector< int > *iattr, std::vector< int > *oattr)
 The default type inference function, which assigns all undefined types to the same type of one of the inputs or outputs. More...
 
bool DefaultStorageType (const nnvm::NodeAttrs &attrs, const int dev_mask, DispatchMode *dispatch_mode, std::vector< int > *iattr, std::vector< int > *oattr)
 The default storage type inference function, which assigns all undefined storage types to kDefaultStorage. If all of input and output storage types are kDefaultStorage, DispatchMode::kFCompute is assigned to dispatch_mode. Otherwise, DispatchMode::kFComputeFallback is assigned to dispatch_mode. More...
 
std::string storage_str (int storage_id)
 
void LogMemoryPlan (const nnvm::Graph &g)
 
void LogInferStorage (const nnvm::Graph &g)
 
void HandleInferShapeError (const size_t num_forward_inputs, const nnvm::IndexedGraph &idx, const nnvm::ShapeVector &inferred_shapes)
 
void HandleInferTypeError (const size_t num_forward_inputs, const nnvm::IndexedGraph &idx, const nnvm::DTypeVector &inferred_dtypes)
 
void HandleInferStorageTypeError (const size_t num_forward_inputs, const nnvm::IndexedGraph &idx, const StorageTypeVector &inferred_stypes)
 
NDArray ReshapeOrCreate (const std::string &name, const TShape &dest_arg_shape, const int dest_arg_dtype, const NDArrayStorageType dest_arg_stype, const Context &ctx, std::unordered_map< std::string, NDArray > *shared_buffer, bool enable_row_sparse_sharing)
 If the requested ndarray's shape size is less than the corresponding shared_data_array's shape size and the storage type is shareable, reuse the memory allocation in shared_buffer; otherwise, create a zero ndarray. Shareable storages include both default storage and row_sparse storage if enable_row_sparse_sharing is True, otherwise default storage only. More...
 
nnvm::Graph AssignContext (nnvm::Graph g, const Context &default_ctx, const std::map< std::string, Context > &ctx_map, const std::vector< Context > &in_arg_ctxes, const std::vector< Context > &arg_grad_ctxes, const std::vector< Context > &aux_state_ctxes, const std::vector< OpReqType > &grad_req_types, size_t num_forward_inputs, size_t num_forward_outputs)
 Assign context to the graph. This is triggered by both simple_bind and bind flows. More...
 
template<typename T >
size_t SerializedSize (const T &obj)
 
template<typename T >
size_t SerializedSize (const nnvm::Tuple< T > &obj)
 
template<typename K , typename V >
size_t SerializedSize (const std::map< K, V > &obj)
 
template<>
size_t SerializedSize (const std::string &obj)
 
template<typename... Args>
size_t SerializedSize (const std::tuple< Args... > &obj)
 
template<typename T >
void Serialize (const T &obj, char **buffer)
 
template<typename T >
void Serialize (const nnvm::Tuple< T > &obj, char **buffer)
 
template<typename K , typename V >
void Serialize (const std::map< K, V > &obj, char **buffer)
 
template<>
void Serialize (const std::string &obj, char **buffer)
 
template<typename... Args>
void Serialize (const std::tuple< Args... > &obj, char **buffer)
 
template<typename T >
void Deserialize (T *obj, const std::string &buffer, size_t *curr_pos)
 
template<typename T >
void Deserialize (nnvm::Tuple< T > *obj, const std::string &buffer, size_t *curr_pos)
 
template<typename K , typename V >
void Deserialize (std::map< K, V > *obj, const std::string &buffer, size_t *curr_pos)
 
template<>
void Deserialize (std::string *obj, const std::string &buffer, size_t *curr_pos)
 
template<typename... Args>
void Deserialize (std::tuple< Args... > *obj, const std::string &buffer, size_t *curr_pos)
 
template<typename T >
size_t SerializedContainerSize (const T &obj, char **buffer)
 
template<typename T >
size_t DeserializedContainerSize (T *obj, const std::string &buffer, size_t *curr_pos)
 
template<typename T >
void Serialize (const T &obj, std::string *serialized_data)
 
template<typename T >
void Deserialize (T *obj, const std::string &serialized_data)
 
template<typename xpu >
void CheckFormatWrapper (const RunContext &rctx, const NDArray &input, const TBlob &err_cpu, const bool full_check)
 
template<typename xpu >
void CheckFormatCSRImpl (const RunContext &rctx, const NDArray &input, const TBlob &err_cpu, const bool full_check)
 Check the validity of CSRNDArray. More...
 
template<typename xpu >
void CheckFormatRSPImpl (const RunContext &rctx, const NDArray &input, const TBlob &err_cpu, const bool full_check)
 Check the validity of RowSparseNDArray. More...
 
template<typename xpu >
void CheckFormatImpl (const RunContext &rctx, const NDArray &input, const TBlob &err_cpu, const bool full_check)
 
template<typename xpu >
void SparseRetainOpForwardRspWrapper (mshadow::Stream< xpu > *s, const NDArray &input_nd, const TBlob &idx_data, const OpReqType req, NDArray *output_nd)
 Pick rows specified by user input index array from a row sparse ndarray and save them in the output sparse ndarray. More...
 
template<typename xpu >
void CastStorageDispatch (const OpContext &ctx, const NDArray &input, const NDArray &output)
 
bool ContainsOnlyStorage (const StorageTypeVector &vstorage, const NDArrayStorageType stype)
 returns true if all storage types in vstorage are the same as target stype. false is returned for empty inputs. More...
 
bool ContainsOnlyStorage (const StorageTypeVector &vstorage, const NDArrayStorageType stype1, const NDArrayStorageType stype2, bool *has_both)
 returns true if all storage types in vstorage are the same as target stype1 or `stype2'. Sets boolean if both found. false is returned for empty inputs. More...
 
bool ContainsOnlyStorage (const std::vector< NDArray > &ndarrays, const NDArrayStorageType stype)
 returns true if the storage types of arrays in ndarrays are the same as target stype. false is returned for empty inputs. More...
 
bool ContainsOnlyStorage (const std::vector< NDArray > &ndarrays, const NDArrayStorageType stype1, const NDArrayStorageType stype2, bool *has_both)
 returns true if the storage types of arrays in ndarrays are the same as targets stype1 or stype2. false is returned for empty inputs. More...
 
bool ContainsStorageType (const std::vector< NDArray > &ndarrays, const NDArrayStorageType stype)
 returns true if storage type of any array in ndarrays is the same as the target stype. false is returned for empty inputs. More...
 
bool ContainsStorageType (const std::vector< int > &ndstypes, const NDArrayStorageType stype)
 returns true if any storage type ndstype in ndstypes is the same as the target stype. false is returned for empty inputs. More...
 
std::string dispatch_mode_string (const DispatchMode x)
 get string representation of dispatch_mode More...
 
std::string stype_string (const int x)
 get string representation of storage_type More...
 
std::string dev_type_string (const int dev_type)
 get string representation of device type More...
 
std::string operator_stype_string (const nnvm::NodeAttrs &attrs, const int dev_mask, const std::vector< int > &in_attrs, const std::vector< int > &out_attrs)
 get string representation of the operator stypes More...
 
std::string operator_string (const nnvm::NodeAttrs &attrs, const OpContext &ctx, const std::vector< NDArray > &inputs, const std::vector< OpReqType > &req, const std::vector< NDArray > &outputs)
 get string representation of the operator More...
 
void LogOnce (const std::string &message)
 log message once. Intended for storage fallback warning messages. More...
 
void LogStorageFallback (const nnvm::NodeAttrs &attrs, const int dev_mask, const std::vector< int > *in_attrs, const std::vector< int > *out_attrs)
 log storage fallback event More...
 
int GetNumThreadsPerGPU ()
 
int GetExecNumMatchColor ()
 
template<typename T , typename V >
ParallelAccumulate (const T *a, const int n, V start)
 
template<typename RandomIt , typename Compare >
void ParallelSortHelper (RandomIt first, size_t len, size_t grainsize, const Compare &comp)
 Helper function for ParallelSort. DO NOT call this function directly. Use the interface ParallelSort instead. Ref: https://github.com/dmlc/difacto/blob/master/src/common/parallel_sort.h. More...
 
template<typename RandomIt , typename Compare >
void ParallelSort (RandomIt first, RandomIt last, size_t num_threads, Compare comp)
 Sort the elements in the range [first, last) into the ascending order defined by the comparator comp. If the length of the range [first, last) is greater than a certain threshold, the range will be recursively divided into two and assign two threads to sort each half range. Ref: https://github.com/dmlc/difacto/blob/master/src/common/parallel_sort.h. More...
 
template<typename RandomIt >
void ParallelSort (RandomIt first, RandomIt last, size_t num_threads)
 Sort the elements in the range [first, last) into ascending order. The elements are compared using the default < operator. If the length of the range [first, last) is greater than a certain threshold, the range will be recursively divided into two and assign two threads to sort each half range. Ref: https://github.com/dmlc/difacto/blob/master/src/common/parallel_sort.h. More...
 
template<class T , class... Args>
helper::UniqueIf< T >::SingleObject MakeUnique (Args &&...args)
 Constructs an object of type T and wraps it in a std::unique_ptr. More...
 
template<class T >
helper::UniqueIf< T >::UnknownBound MakeUnique (size_t n)
 Constructs an object of type T and wraps it in a std::unique_ptr. More...
 
template<class T , class... Args>
helper::UniqueIf< T >::KnownBound MakeUnique (Args &&...args)=delete
 Constructs an object of type T and wraps it in a std::unique_ptr. More...
 
template<typename FCompType >
FCompType GetFCompute (const nnvm::Op *op, const std::string &name, const Context &ctx)
 
template<typename T >
constexpr size_t MaxIntegerValue ()
 Return the max integer value representable in the type T without loss of precision. More...
 
template<>
constexpr size_t MaxIntegerValue< mshadow::half::half_t > ()
 
MSHADOW_XINLINE int ilog2ul (size_t a)
 
MSHADOW_XINLINE int ilog2ui (unsigned int a)
 
NDArray InitZeros (const NDArrayStorageType stype, const TShape &shape, const Context &ctx, const int dtype)
 Return an NDArray of all zeros. More...
 
void EmplaceBackZeros (const NDArrayStorageType stype, const TShape &shape, const Context &ctx, const int dtype, std::vector< NDArray > *vec)
 Helper to add a NDArray of zeros to a std::vector. More...
 

Typedef Documentation

typedef std::mt19937 mxnet::common::RANDOM_ENGINE

Random Engine.

Function Documentation

nnvm::Graph mxnet::common::AssignContext ( nnvm::Graph  g,
const Context default_ctx,
const std::map< std::string, Context > &  ctx_map,
const std::vector< Context > &  in_arg_ctxes,
const std::vector< Context > &  arg_grad_ctxes,
const std::vector< Context > &  aux_state_ctxes,
const std::vector< OpReqType > &  grad_req_types,
size_t  num_forward_inputs,
size_t  num_forward_outputs 
)
inline

Assign context to the graph. This is triggered by both simple_bind and bind flows.

void mxnet::common::CastNonDefaultStorage ( const std::vector< NDArray > &  src,
const std::vector< NDArray > &  dst,
const OpContext ctx,
const bool  is_gpu 
)
inline
template<typename xpu >
void mxnet::common::CastStorageDispatch ( const OpContext ctx,
const NDArray input,
const NDArray output 
)
template<typename xpu >
void mxnet::common::CheckFormatCSRImpl ( const RunContext rctx,
const NDArray input,
const TBlob err_cpu,
const bool  full_check 
)

Check the validity of CSRNDArray.

Parameters
rctxExecution context.
inputInput NDArray of CSRStorage.
err_cpuError number on cpu.
full_checkIf true, rigorous check, O(N) operations, otherwise basic check, O(1) operations.
template<typename xpu >
void mxnet::common::CheckFormatImpl ( const RunContext rctx,
const NDArray input,
const TBlob err_cpu,
const bool  full_check 
)
template<typename xpu >
void mxnet::common::CheckFormatRSPImpl ( const RunContext rctx,
const NDArray input,
const TBlob err_cpu,
const bool  full_check 
)

Check the validity of RowSparseNDArray.

Parameters
rctxExecution context.
inputInput NDArray of RowSparseStorage.
err_cpuError number on cpu.
full_checkIf true, rigorous check, O(N) operations, otherwise basic check, O(1) operations.
template<typename xpu >
void mxnet::common::CheckFormatWrapper ( const RunContext rctx,
const NDArray input,
const TBlob err_cpu,
const bool  full_check 
)
bool mxnet::common::ContainsOnlyStorage ( const StorageTypeVector vstorage,
const NDArrayStorageType  stype 
)
inline

returns true if all storage types in vstorage are the same as target stype. false is returned for empty inputs.

bool mxnet::common::ContainsOnlyStorage ( const StorageTypeVector vstorage,
const NDArrayStorageType  stype1,
const NDArrayStorageType  stype2,
bool *  has_both 
)
inline

returns true if all storage types in vstorage are the same as target stype1 or `stype2'. Sets boolean if both found. false is returned for empty inputs.

bool mxnet::common::ContainsOnlyStorage ( const std::vector< NDArray > &  ndarrays,
const NDArrayStorageType  stype 
)
inline

returns true if the storage types of arrays in ndarrays are the same as target stype. false is returned for empty inputs.

bool mxnet::common::ContainsOnlyStorage ( const std::vector< NDArray > &  ndarrays,
const NDArrayStorageType  stype1,
const NDArrayStorageType  stype2,
bool *  has_both 
)
inline

returns true if the storage types of arrays in ndarrays are the same as targets stype1 or stype2. false is returned for empty inputs.

bool mxnet::common::ContainsStorageType ( const std::vector< NDArray > &  ndarrays,
const NDArrayStorageType  stype 
)
inline

returns true if storage type of any array in ndarrays is the same as the target stype. false is returned for empty inputs.

bool mxnet::common::ContainsStorageType ( const std::vector< int > &  ndstypes,
const NDArrayStorageType  stype 
)
inline

returns true if any storage type ndstype in ndstypes is the same as the target stype. false is returned for empty inputs.

bool mxnet::common::DefaultStorageType ( const nnvm::NodeAttrs &  attrs,
const int  dev_mask,
DispatchMode dispatch_mode,
std::vector< int > *  iattr,
std::vector< int > *  oattr 
)
inline

The default storage type inference function, which assigns all undefined storage types to kDefaultStorage. If all of input and output storage types are kDefaultStorage, DispatchMode::kFCompute is assigned to dispatch_mode. Otherwise, DispatchMode::kFComputeFallback is assigned to dispatch_mode.

template<typename T >
void mxnet::common::Deserialize ( T *  obj,
const std::string &  buffer,
size_t *  curr_pos 
)
inline
template<typename T >
void mxnet::common::Deserialize ( nnvm::Tuple< T > *  obj,
const std::string &  buffer,
size_t *  curr_pos 
)
inline
template<typename K , typename V >
void mxnet::common::Deserialize ( std::map< K, V > *  obj,
const std::string &  buffer,
size_t *  curr_pos 
)
inline
template<>
void mxnet::common::Deserialize ( std::string *  obj,
const std::string &  buffer,
size_t *  curr_pos 
)
inline
template<typename... Args>
void mxnet::common::Deserialize ( std::tuple< Args... > *  obj,
const std::string &  buffer,
size_t *  curr_pos 
)
inline
template<typename T >
void mxnet::common::Deserialize ( T *  obj,
const std::string &  serialized_data 
)
inline
template<typename T >
size_t mxnet::common::DeserializedContainerSize ( T *  obj,
const std::string &  buffer,
size_t *  curr_pos 
)
inline
std::string mxnet::common::dev_type_string ( const int  dev_type)
inline

get string representation of device type

std::string mxnet::common::dispatch_mode_string ( const DispatchMode  x)
inline

get string representation of dispatch_mode

void mxnet::common::EmplaceBackZeros ( const NDArrayStorageType  stype,
const TShape shape,
const Context ctx,
const int  dtype,
std::vector< NDArray > *  vec 
)
inline

Helper to add a NDArray of zeros to a std::vector.

int mxnet::common::GetExecNumMatchColor ( )
inline
template<typename FCompType >
FCompType mxnet::common::GetFCompute ( const nnvm::Op *  op,
const std::string &  name,
const Context ctx 
)
int mxnet::common::GetNumThreadsPerGPU ( )
inline
void mxnet::common::HandleInferShapeError ( const size_t  num_forward_inputs,
const nnvm::IndexedGraph &  idx,
const nnvm::ShapeVector &  inferred_shapes 
)
inline
void mxnet::common::HandleInferStorageTypeError ( const size_t  num_forward_inputs,
const nnvm::IndexedGraph &  idx,
const StorageTypeVector inferred_stypes 
)
inline
void mxnet::common::HandleInferTypeError ( const size_t  num_forward_inputs,
const nnvm::IndexedGraph &  idx,
const nnvm::DTypeVector &  inferred_dtypes 
)
inline
MSHADOW_XINLINE int mxnet::common::ilog2ui ( unsigned int  a)
MSHADOW_XINLINE int mxnet::common::ilog2ul ( size_t  a)
NDArray mxnet::common::InitZeros ( const NDArrayStorageType  stype,
const TShape shape,
const Context ctx,
const int  dtype 
)
inline

Return an NDArray of all zeros.

void mxnet::common::LogInferStorage ( const nnvm::Graph &  g)
inline
void mxnet::common::LogMemoryPlan ( const nnvm::Graph &  g)
inline
void mxnet::common::LogOnce ( const std::string &  message)
inline

log message once. Intended for storage fallback warning messages.

void mxnet::common::LogStorageFallback ( const nnvm::NodeAttrs &  attrs,
const int  dev_mask,
const std::vector< int > *  in_attrs,
const std::vector< int > *  out_attrs 
)
inline

log storage fallback event

template<class T , class... Args>
helper::UniqueIf<T>::SingleObject mxnet::common::MakeUnique ( Args &&...  args)
delete

Constructs an object of type T and wraps it in a std::unique_ptr.

Parameters
argsList of arguments with which an instance of T will be constructed.
Returns
std::unique_ptr of an instance of type T.

Constructs a non-array type T. The arguments args are passed to the constructor of T. The function does not participate in the overload resolution if T is an array type.

template<class T >
helper::UniqueIf<T>::UnknownBound mxnet::common::MakeUnique ( size_t  n)

Constructs an object of type T and wraps it in a std::unique_ptr.

Parameters
nThe size of the array to construct.
Returns
std::unique_ptr of an instance of type T.

Constructs an array of unknown bound T. The function does not participate in the overload resolution unless T is an array of unknown bound.

template<class T , class... Args>
helper::UniqueIf<T>::KnownBound mxnet::common::MakeUnique ( Args &&...  args)
delete

Constructs an object of type T and wraps it in a std::unique_ptr.

Parameters
argsList of arguments with which an instance of T will be constructed.

Constructs an arrays of known bound is disallowed.

Parameters
argsList of arguments with which an instance of T will be constructed.
Returns
std::unique_ptr of an instance of type T.

Constructs a non-array type T. The arguments args are passed to the constructor of T. The function does not participate in the overload resolution if T is an array type.

template<typename T >
constexpr size_t mxnet::common::MaxIntegerValue ( )

Return the max integer value representable in the type T without loss of precision.

template<>
constexpr size_t mxnet::common::MaxIntegerValue< mshadow::half::half_t > ( )
std::string mxnet::common::operator_string ( const nnvm::NodeAttrs &  attrs,
const OpContext ctx,
const std::vector< NDArray > &  inputs,
const std::vector< OpReqType > &  req,
const std::vector< NDArray > &  outputs 
)
inline

get string representation of the operator

std::string mxnet::common::operator_stype_string ( const nnvm::NodeAttrs &  attrs,
const int  dev_mask,
const std::vector< int > &  in_attrs,
const std::vector< int > &  out_attrs 
)
inline

get string representation of the operator stypes

template<typename T , typename V >
V mxnet::common::ParallelAccumulate ( const T *  a,
const int  n,
start 
)
template<typename RandomIt , typename Compare >
void mxnet::common::ParallelSort ( RandomIt  first,
RandomIt  last,
size_t  num_threads,
Compare  comp 
)

Sort the elements in the range [first, last) into the ascending order defined by the comparator comp. If the length of the range [first, last) is greater than a certain threshold, the range will be recursively divided into two and assign two threads to sort each half range. Ref: https://github.com/dmlc/difacto/blob/master/src/common/parallel_sort.h.

template<typename RandomIt >
void mxnet::common::ParallelSort ( RandomIt  first,
RandomIt  last,
size_t  num_threads 
)

Sort the elements in the range [first, last) into ascending order. The elements are compared using the default < operator. If the length of the range [first, last) is greater than a certain threshold, the range will be recursively divided into two and assign two threads to sort each half range. Ref: https://github.com/dmlc/difacto/blob/master/src/common/parallel_sort.h.

template<typename RandomIt , typename Compare >
void mxnet::common::ParallelSortHelper ( RandomIt  first,
size_t  len,
size_t  grainsize,
const Compare &  comp 
)

Helper function for ParallelSort. DO NOT call this function directly. Use the interface ParallelSort instead. Ref: https://github.com/dmlc/difacto/blob/master/src/common/parallel_sort.h.

NDArray mxnet::common::ReshapeOrCreate ( const std::string &  name,
const TShape dest_arg_shape,
const int  dest_arg_dtype,
const NDArrayStorageType  dest_arg_stype,
const Context ctx,
std::unordered_map< std::string, NDArray > *  shared_buffer,
bool  enable_row_sparse_sharing 
)
inline

If the requested ndarray's shape size is less than the corresponding shared_data_array's shape size and the storage type is shareable, reuse the memory allocation in shared_buffer; otherwise, create a zero ndarray. Shareable storages include both default storage and row_sparse storage if enable_row_sparse_sharing is True, otherwise default storage only.

bool mxnet::common::SameType ( const nnvm::NodeAttrs &  attrs,
std::vector< int > *  iattr,
std::vector< int > *  oattr 
)
inline

The default type inference function, which assigns all undefined types to the same type of one of the inputs or outputs.

template<typename T >
void mxnet::common::Serialize ( const T &  obj,
char **  buffer 
)
inline
template<typename T >
void mxnet::common::Serialize ( const nnvm::Tuple< T > &  obj,
char **  buffer 
)
inline
template<typename K , typename V >
void mxnet::common::Serialize ( const std::map< K, V > &  obj,
char **  buffer 
)
inline
template<>
void mxnet::common::Serialize ( const std::string &  obj,
char **  buffer 
)
inline
template<typename... Args>
void mxnet::common::Serialize ( const std::tuple< Args... > &  obj,
char **  buffer 
)
inline
template<typename T >
void mxnet::common::Serialize ( const T &  obj,
std::string *  serialized_data 
)
inline
template<typename T >
size_t mxnet::common::SerializedContainerSize ( const T &  obj,
char **  buffer 
)
inline
template<typename T >
size_t mxnet::common::SerializedSize ( const T &  obj)
inline
template<typename T >
size_t mxnet::common::SerializedSize ( const nnvm::Tuple< T > &  obj)
inline
template<typename K , typename V >
size_t mxnet::common::SerializedSize ( const std::map< K, V > &  obj)
inline
template<>
size_t mxnet::common::SerializedSize ( const std::string &  obj)
inline
template<typename... Args>
size_t mxnet::common::SerializedSize ( const std::tuple< Args... > &  obj)
inline
bool mxnet::common::SetupDefaultBlobsIn ( const std::vector< NDArray > &  src,
const std::vector< NDArray > *  bufs,
std::vector< TBlob > *  blobs,
std::vector< NDArray > *  temp_src,
std::vector< NDArray > *  temp_dst,
std::unordered_map< uint32_t, uint32_t > *  idx_map 
)
inline
void mxnet::common::SetupDefaultBlobsInOut ( const std::vector< NDArray > &  ndinputs,
const std::vector< NDArray > &  ndoutputs,
const std::vector< NDArray > *  in_bufs,
const std::vector< NDArray > *  out_bufs,
std::vector< OpReqType > *  req,
std::vector< TBlob > *  input_blobs,
std::vector< TBlob > *  output_blobs,
std::vector< NDArray > *  pre_temp_src,
std::vector< NDArray > *  pre_temp_dst,
std::vector< NDArray > *  post_temp_src,
std::vector< NDArray > *  post_temp_dst,
std::unordered_map< uint32_t, uint32_t > *  in_temp_idx_map,
const std::vector< uint32_t > &  mutate_idx 
)
inline
bool mxnet::common::SetupDefaultBlobsOut ( const std::vector< NDArray > &  src,
const std::vector< NDArray > *  bufs,
std::vector< OpReqType > *  req,
std::vector< TBlob > *  blobs,
std::vector< NDArray > *  temp_src,
std::vector< NDArray > *  temp_dst 
)
inline
template<typename xpu >
void mxnet::common::SparseRetainOpForwardRspWrapper ( mshadow::Stream< xpu > *  s,
const NDArray input_nd,
const TBlob idx_data,
const OpReqType  req,
NDArray output_nd 
)

Pick rows specified by user input index array from a row sparse ndarray and save them in the output sparse ndarray.

std::string mxnet::common::storage_str ( int  storage_id)
inline
std::string mxnet::common::stype_string ( const int  x)
inline

get string representation of storage_type