Dragon - C++ API
A Computation Graph Virtual Machine Based Deep Learning Framework
Public Types | Public Member Functions | List of all members
dragon::onnx::ONNXBackend Class Reference

#include <onnx_backend.h>

Public Types

using SpecialNodeConverter = ONNXImporterReturns(ONNXBackend::*)(ONNXNode *, const ConversionContext &)
 

Public Member Functions

void BuildTensorFillOp (const TensorProto &onnx_tensor, OperatorDef *op_def)
 
ONNXImporterReturns CommonONNXNodeImporter (ONNXNode *onnx_node, const ConversionContext &ctx)
 
ONNXImporterReturns ConvPoolNodeImporter (ONNXNode *onnx_node, const ConversionContext &ctx)
 
ONNXImporterReturns GemmNodeImporter (ONNXNode *onnx_node, const ConversionContext &ctx)
 
ONNXImporterReturns BatchNormNodeImporter (ONNXNode *onnx_node, const ConversionContext &ctx)
 
ONNXImporterReturns UpsampleNodeImporter (ONNXNode *onnx_node, const ConversionContext &ctx)
 
ONNXImporterReturns ReshapeNodeImporter (ONNXNode *onnx_node, const ConversionContext &ctx)
 
ONNXImporterReturns ATenNodeImporter (ONNXNode *onnx_node, const ConversionContext &ctx)
 
ONNXImporterReturns MaxRoiPoolNodeImporter (ONNXNode *onnx_node, const ConversionContext &ctx)
 
ONNXImporterReturns CastNodeImporter (ONNXNode *onnx_node, const ConversionContext &ctx)
 
ONNXImporterReturns LpNormNodeImporter (ONNXNode *onnx_node, const ConversionContext &ctx)
 
ONNXImporterReturns ArgReduceNodeImporter (ONNXNode *onnx_node, const ConversionContext &ctx)
 
void Prepare (const string &onnx_model_path, GraphDef *init_graph, GraphDef *pred_graph)
 
void ONNXTensorToArgument (const TensorProto &onnx_tensor, Argument *dtype, Argument *values)
 
ONNXImporterReturns ONNXNodeToOps (const ModelProto &init_model, const ModelProto &pred_model, const ConversionContext &ctx, ONNXNode *onnx_node)
 
void ONNXToDragon (const ModelProto &onnx_model, const int opset_version, const bool include_initializers, GraphDef *init_graph, GraphDef *pred_graph)
 
const Map< string, string > & get_renamed_nodes () const
 
const Map< string, SpecialNodeConverter > & get_special_nodes () const
 
const Map< string, string > & get_renamed_attrs () const
 
const Map< string, Map< string, string > > & get_node_renamed_attrs () const
 

Member Typedef Documentation

◆ SpecialNodeConverter

Member Function Documentation

◆ ArgReduceNodeImporter()

ONNXImporterReturns dragon::onnx::ONNXBackend::ArgReduceNodeImporter ( ONNXNode onnx_node,
const ConversionContext ctx 
)

ArgReduce

◆ ATenNodeImporter()

ONNXImporterReturns dragon::onnx::ONNXBackend::ATenNodeImporter ( ONNXNode onnx_node,
const ConversionContext ctx 
)

Internal Dragon Operators

◆ BatchNormNodeImporter()

ONNXImporterReturns dragon::onnx::ONNXBackend::BatchNormNodeImporter ( ONNXNode onnx_node,
const ConversionContext ctx 
)

FusedBatchNorm

◆ BuildTensorFillOp()

void dragon::onnx::ONNXBackend::BuildTensorFillOp ( const TensorProto &  onnx_tensor,
OperatorDef *  op_def 
)

◆ CastNodeImporter()

ONNXImporterReturns dragon::onnx::ONNXBackend::CastNodeImporter ( ONNXNode onnx_node,
const ConversionContext ctx 
)

AsType

◆ CommonONNXNodeImporter()

ONNXImporterReturns dragon::onnx::ONNXBackend::CommonONNXNodeImporter ( ONNXNode onnx_node,
const ConversionContext ctx 
)

Common Operators

◆ ConvPoolNodeImporter()

ONNXImporterReturns dragon::onnx::ONNXBackend::ConvPoolNodeImporter ( ONNXNode onnx_node,
const ConversionContext ctx 
)

Conv2d, ConvTranspose2d, Pool2d

◆ GemmNodeImporter()

ONNXImporterReturns dragon::onnx::ONNXBackend::GemmNodeImporter ( ONNXNode onnx_node,
const ConversionContext ctx 
)

FullyConnected

◆ get_node_renamed_attrs()

const Map< string, Map< string, string > > & dragon::onnx::ONNXBackend::get_node_renamed_attrs ( ) const

◆ get_renamed_attrs()

const Map< string, string > & dragon::onnx::ONNXBackend::get_renamed_attrs ( ) const

◆ get_renamed_nodes()

const Map< string, string > & dragon::onnx::ONNXBackend::get_renamed_nodes ( ) const

◆ get_special_nodes()

const Map< string, ONNXBackend::SpecialNodeConverter > & dragon::onnx::ONNXBackend::get_special_nodes ( ) const

◆ LpNormNodeImporter()

ONNXImporterReturns dragon::onnx::ONNXBackend::LpNormNodeImporter ( ONNXNode onnx_node,
const ConversionContext ctx 
)

L2Norm

◆ MaxRoiPoolNodeImporter()

ONNXImporterReturns dragon::onnx::ONNXBackend::MaxRoiPoolNodeImporter ( ONNXNode onnx_node,
const ConversionContext ctx 
)

ROIPool

◆ ONNXNodeToOps()

ONNXImporterReturns dragon::onnx::ONNXBackend::ONNXNodeToOps ( const ModelProto &  init_model,
const ModelProto &  pred_model,
const ConversionContext ctx,
ONNXNode onnx_node 
)

◆ ONNXTensorToArgument()

void dragon::onnx::ONNXBackend::ONNXTensorToArgument ( const TensorProto &  onnx_tensor,
Argument *  dtype,
Argument *  values 
)

float16: raw_data = >floats

float32: float_data | raw_data => floats

float64: double_data | raw_data => floats

int64: int64_data | raw_data => ints

uint64: uint64_data | raw_data => ints

uint32: uint64_data | raw_data => ints

bool: int32_data | raw_data => ints

uint8: int32_data | raw_data => ints

int8: int32_data | raw_data => ints

uint16: int32_data | raw_data => ints

int16: int32_data | raw_data => ints

int32: int32_data | raw_data => ints

string: string_data => strings

◆ ONNXToDragon()

void dragon::onnx::ONNXBackend::ONNXToDragon ( const ModelProto &  onnx_model,
const int  opset_version,
const bool  include_initializers,
GraphDef *  init_graph,
GraphDef *  pred_graph 
)

◆ Prepare()

void dragon::onnx::ONNXBackend::Prepare ( const string &  onnx_model_path,
GraphDef *  init_graph,
GraphDef *  pred_graph 
)

◆ ReshapeNodeImporter()

ONNXImporterReturns dragon::onnx::ONNXBackend::ReshapeNodeImporter ( ONNXNode onnx_node,
const ConversionContext ctx 
)

Reshape

◆ UpsampleNodeImporter()

ONNXImporterReturns dragon::onnx::ONNXBackend::UpsampleNodeImporter ( ONNXNode onnx_node,
const ConversionContext ctx 
)

NNResize, BilinearResize


The documentation for this class was generated from the following files: