Dragon - C++ API
A Computation Graph Virtual Machine Based Deep Learning Framework
Classes | Functions
dragon::python Namespace Reference


class  NumpyFeeder
class  NumpyFetcher
class  StringFetcher
class  TensorFeederBase
class  TensorFetcherBase


void AddGradientMethods (pybind11::module &m)
void AddConfigMethods (pybind11::module &m)
 DECLARE_TYPED_REGISTRY (TensorFetcherRegistry, TypeId, TensorFetcherBase)
TensorFetcherBaseCreateFetcher (TypeId type)
 DECLARE_TYPED_REGISTRY (TensorFeederRegistry, TypeId, TensorFeederBase)
 DEFINE_TYPED_REGISTRY (TensorFetcherRegistry, TypeId, TensorFetcherBase)
 DEFINE_TYPED_REGISTRY (TensorFeederRegistry, TypeId, TensorFeederBase)
TypeId CTypeToFetcher (TypeId type)
 REGISTER_TENSOR_FETCHER (TypeMeta::Id< NumpyFetcher >(), NumpyFetcher)
 REGISTER_TENSOR_FETCHER (TypeMeta::Id< StringFetcher >(), StringFetcher)
 REGISTER_TENSOR_FEEDER (TypeMeta::Id< NumpyFeeder >(), NumpyFeeder)
void OnImportModule ()
 PYBIND11_MODULE (libdragon, m)
void AddMPIMethods (pybind11::module &m)
void AddOperatorMethods (pybind11::module &m)
void AddProtoMethods (pybind11::module &m)
void AddTensorMethods (pybind11::module &m)
const int TypeMetaToNPY (const TypeMeta &meta)
const TypeMetaTypeNPYToMeta (int npy_type)

Function Documentation

◆ AddConfigMethods()

void dragon::python::AddConfigMethods ( pybind11::module &  m)

◆ AddGradientMethods()

void dragon::python::AddGradientMethods ( pybind11::module &  m)

◆ AddMPIMethods()

void dragon::python::AddMPIMethods ( pybind11::module &  m)

◆ AddOperatorMethods()

void dragon::python::AddOperatorMethods ( pybind11::module &  m)

Return the registered operators

Return the non-gradient operators

◆ AddProtoMethods()

void dragon::python::AddProtoMethods ( pybind11::module &  m)

Extented C-Style OperatorDef

◆ AddTensorMethods()

void dragon::python::AddTensorMethods ( pybind11::module &  m)

Export the Tensor class

Return the number of dimensions

Return all the dimensions

Return the total number of elements

Return the data type

Return the device information

Switch the memory to the cpu context

Switch the memory to the cuda context

◆ CreateFetcher()

TensorFetcherBase* dragon::python::CreateFetcher ( TypeId  type)

◆ CTypeToFetcher()

TypeId dragon::python::CTypeToFetcher ( TypeId  type)


dragon::python::DECLARE_TYPED_REGISTRY ( TensorFetcherRegistry  ,
TypeId  ,


dragon::python::DECLARE_TYPED_REGISTRY ( TensorFeederRegistry  ,
TypeId  ,


dragon::python::DEFINE_TYPED_REGISTRY ( TensorFetcherRegistry  ,
TypeId  ,


dragon::python::DEFINE_TYPED_REGISTRY ( TensorFeederRegistry  ,
TypeId  ,

◆ OnImportModule()

void dragon::python::OnImportModule ( )


dragon::python::PYBIND11_MODULE ( libdragon  ,

Export the Workspace class

Return the name of this workspace

Return the name of stored tensors

Return the name of stored graphs

Destory all the tensors

Merge a external workspace into self

Return a unique dummy name

Return the unique name of given tensor

Reset a tensor with the given name

Indicate whether the given tensor is existing

Create a tensor with the given name

Create a tensor from the specified filler

Create a tensor with the given shape

Create a tensor with the given array

Create a tensor copied from an existing one

Return a array zero-copied from an existing tensor

Return the CXX Tensor reference

Copy the array data to tensor

Copy the tensor data to the array

Run a operator from the def reference

Run a operator from the serialized def

Create a graph from the serialized def

Run an existing graph

Serialize tensors into a binary file

Load tensors from a binary file

Load tensors and graph from a ONNX model


dragon::python::REGISTER_TENSOR_FEEDER ( TypeMeta::Id< NumpyFeeder (),


dragon::python::REGISTER_TENSOR_FETCHER ( TypeMeta::Id< NumpyFetcher (),


dragon::python::REGISTER_TENSOR_FETCHER ( TypeMeta::Id< StringFetcher (),

◆ TypeMetaToNPY()

const int dragon::python::TypeMetaToNPY ( const TypeMeta meta)

◆ TypeNPYToMeta()

const TypeMeta& dragon::python::TypeNPYToMeta ( int  npy_type)