mxnet
Namespaces | Functions
exec_utils.h File Reference

Common utility functions for executors. More...

#include <nnvm/graph.h>
#include <nnvm/pass_functions.h>
#include <map>
#include <vector>
#include <string>
#include <utility>
#include "../common/utils.h"
#include "../executor/exec_pass.h"
Include dependency graph for exec_utils.h:

Go to the source code of this file.

Namespaces

 mxnet
 namespace of mxnet
 
 mxnet::common
 

Functions

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)
 
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)
 
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)
 
void mxnet::common::CastNonDefaultStorage (const std::vector< NDArray > &src, const std::vector< NDArray > &dst, const OpContext &ctx, const bool is_gpu)
 
bool mxnet::common::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 mxnet::common::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 mxnet::common::storage_str (int storage_id)
 
void mxnet::common::LogMemoryPlan (const nnvm::Graph &g)
 
void mxnet::common::LogInferStorage (const nnvm::Graph &g)
 
void mxnet::common::HandleInferShapeError (const size_t num_forward_inputs, const nnvm::IndexedGraph &idx, const mxnet::ShapeVector &inferred_shapes)
 
void mxnet::common::HandleInferTypeError (const size_t num_forward_inputs, const nnvm::IndexedGraph &idx, const nnvm::DTypeVector &inferred_dtypes)
 
void mxnet::common::HandleInferStorageTypeError (const size_t num_forward_inputs, const nnvm::IndexedGraph &idx, const StorageTypeVector &inferred_stypes)
 
NDArray mxnet::common::ReshapeOrCreate (const std::string &name, const mxnet::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 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)
 Assign context to the graph. This is triggered by both simple_bind and bind flows. More...
 
void mxnet::common::CopyGraph (nnvm::Graph *dst, const nnvm::Graph &src, bool copy_variables)
 Copy the graph, optionally leaving original Variable nodes. More...
 
bool mxnet::common::CheckForInputNameDuplicates (const nnvm::IndexedGraph &idx)
 Check whether graph contains any duplicated names in its inputs. More...
 

Detailed Description

Common utility functions for executors.