mxnet
Classes | Namespaces | Macros | Typedefs | Enumerations | Functions
ndarray.h File Reference
#include <dmlc/base.h>
#include <dmlc/logging.h>
#include <dmlc/io.h>
#include <dmlc/type_traits.h>
#include <dmlc/registry.h>
#include <nnvm/node.h>
#include <vector>
#include <map>
#include <string>
#include <memory>
#include "./base.h"
#include "./storage.h"
#include "./engine.h"
Include dependency graph for ndarray.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  mxnet::NDArray
 ndarray interface More...
 
struct  mxnet::NDArrayFunctionReg
 Registry entry for NDArrayFunction. More...
 

Namespaces

 mxnet
 namespace of mxnet
 
 mxnet::csr
 
 mxnet::rowsparse
 
 dmlc
 

Macros

#define MXNET_REGISTER_NDARRAY_FUN(name)   DMLC_REGISTRY_REGISTER(::mxnet::NDArrayFunctionReg, NDArrayFunctionReg, name)
 Macro to register NDArray function. More...
 

Typedefs

typedef std::function< void(NDArray **used_vars, real_t *scalars, NDArray **mutate_vars, int num_params, char **param_keys, char **param_vals)> mxnet::NDArrayAPIFunction
 definition of NDArray function More...
 

Enumerations

enum  mxnet::csr::CSRAuxType { mxnet::csr::kIndPtr, mxnet::csr::kIdx }
 
enum  mxnet::rowsparse::RowSparseAuxType { mxnet::rowsparse::kIdx }
 
enum  mxnet::NDArrayStorageType { mxnet::kUndefinedStorage = -1, mxnet::kDefaultStorage, mxnet::kRowSparseStorage, mxnet::kCSRStorage }
 
enum  mxnet::NDArrayFunctionTypeMask { mxnet::kNDArrayArgBeforeScalar = 1, mxnet::kScalarArgBeforeNDArray = 1 << 1, mxnet::kAcceptEmptyMutateTarget = 1 << 2 }
 mask information on how functions can be exposed More...
 

Functions

size_t mxnet::num_aux_data (NDArrayStorageType stype)
 
void mxnet::CopyFromTo (const NDArray &from, NDArray *to, int priority=0)
 issue an copy operation from one NDArray to another the two ndarray can sit on different devices this operation will be scheduled by the engine More...
 
void mxnet::CopyFromTo (const NDArray &from, const NDArray &to, int priority=0)
 issue an copy operation from one NDArray to another the two ndarray can sit on different devices this operation will be scheduled by the engine More...
 
void mxnet::ElementwiseSum (const std::vector< NDArray > &source, NDArray *out, int priority=0)
 Perform elementwise sum over each data from source, store result into out. More...
 
NDArray mxnet::operator+ (const NDArray &lhs, const NDArray &rhs)
 elementwise add More...
 
NDArray mxnet::operator+ (const NDArray &lhs, const real_t &rhs)
 elementwise add More...
 
NDArray mxnet::operator- (const NDArray &lhs, const NDArray &rhs)
 elementwise subtraction More...
 
NDArray mxnet::operator- (const NDArray &lhs, const real_t &rhs)
 elementwise subtraction More...
 
NDArray mxnet::operator* (const NDArray &lhs, const NDArray &rhs)
 elementwise multiplication More...
 
NDArray mxnet::operator* (const NDArray &lhs, const real_t &rhs)
 elementwise multiplication More...
 
NDArray mxnet::operator/ (const NDArray &lhs, const NDArray &rhs)
 elementwise division More...
 
NDArray mxnet::operator/ (const NDArray &lhs, const real_t &rhs)
 elementwise division More...
 
void mxnet::RandomSeed (uint32_t seed)
 Seed the random number generator. More...
 
void mxnet::SampleUniform (real_t begin, real_t end, NDArray *out)
 Sample uniform distribution for each elements of out. More...
 
void mxnet::SampleGaussian (real_t mu, real_t sigma, NDArray *out)
 Sample gaussian distribution for each elements of out. More...
 
void mxnet::SampleGamma (real_t alpha, real_t beta, NDArray *out)
 Sample gamma distribution for each elements of out. More...
 
void mxnet::SampleExponential (real_t lambda, NDArray *out)
 Sample exponential distribution for each elements of out. More...
 
void mxnet::SamplePoisson (real_t lambda, NDArray *out)
 Sample Poisson distribution for each elements of out. More...
 
void mxnet::SampleNegBinomial (int32_t k, real_t p, NDArray *out)
 Sample negative binomial distribution for each elements of out. More...
 
void mxnet::SampleGenNegBinomial (real_t mu, real_t alpha, NDArray *out)
 Sample generalized negative binomial distribution for each elements of out. More...
 
 dmlc::DMLC_DECLARE_TRAITS (has_saveload, mxnet::NDArray, true)
 traits More...
 

Macro Definition Documentation

#define MXNET_REGISTER_NDARRAY_FUN (   name)    DMLC_REGISTRY_REGISTER(::mxnet::NDArrayFunctionReg, NDArrayFunctionReg, name)

Macro to register NDArray function.

Example: the following code is example to register a plus

1 REGISTER_NDARRAY_FUN(Plus)
2 .set_function(Plus);