ONE - On-device Neural Engine
|
Data Structures | |
class | ConverterContext |
class | ModelContext |
class | NodeConverterRegistry |
Functions | |
std::unique_ptr< mir::Graph > | importModelFromBinaryFile (const std::string &filename) |
std::unique_ptr< mir::Graph > | importModelFromTextFile (const std::string &filename) |
std::unique_ptr< mir::Graph > | loadModel (const std::string &filename) |
template<typename T > | |
T | getAttributeValue (const onnx::AttributeProto &attribute)=delete |
template<> | |
float | getAttributeValue (const onnx::AttributeProto &attribute) |
template<> | |
std::int64_t | getAttributeValue (const onnx::AttributeProto &attribute) |
template<> | |
std::string | getAttributeValue (const onnx::AttributeProto &attribute) |
template<> | |
onnx::TensorProto | getAttributeValue (const onnx::AttributeProto &attribute) |
template<> | |
std::vector< std::int32_t > | getAttributeValue (const onnx::AttributeProto &attribute) |
template<> | |
std::vector< std::int64_t > | getAttributeValue (const onnx::AttributeProto &attribute) |
const onnx::AttributeProto * | findAttribute (const onnx::NodeProto &node, const std::string &name) |
template<typename T > | |
T | getAttributeValue (const onnx::NodeProto &node, const std::string &name) |
template<typename T > | |
T | getAttributeValue (const onnx::NodeProto &node, const std::string &name, T default_value) |
void | inferAutoPadding (const std::string &pad_type, const mir::Shape &input_shape, const std::vector< std::int32_t > &dilations, const std::vector< std::int32_t > &strides, const std::vector< std::int32_t > &window_size, std::vector< std::int32_t > &padding_before, std::vector< std::int32_t > &padding_after) |
std::vector< std::int32_t > | fixPads (const mir::Shape &input_shape, const std::vector< std::int32_t > &pads, const std::vector< std::int32_t > &strides, const std::vector< std::int32_t > &dilation, const std::vector< std::int32_t > &kernel_shape) |
mir::Shape | constantToShape (const mir::ops::ConstantOp *op) |
mir::DataType | onnxDataTypeToMirDataType (onnx::TensorProto::DataType type) |
mir::TensorVariant | createTensor (const onnx::TensorProto *tensor) |
mir::Operation * | foldConstants (mir::Graph *graph, mir::Operation *op) |
template<typename OpType , typename... Types> | |
mir::Operation * | createOp (mir::Graph *graph, Types &&...args) |
void | registerSupportedOps () |
void | convertAbsV1 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertAbsV6 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertAddV1 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertAddV6 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertAddV7 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertAveragePoolV1 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertAveragePoolV7 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertAveragePoolV10 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertBatchNormalizationV1 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertBatchNormalizationV6 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertBatchNormalizationV7 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertBatchNormalizationV9 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertConcatV1 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertConcatV4 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertConstantV1 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertConstantV9 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertConstantV11 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertConvV1 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertConvTransposeV1 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertDivV7 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertDropoutV1 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertDropoutV6 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertDropoutV7 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertDropoutV10 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertEqualV11 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertEqualV7 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertExpandV8 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertFlattenV1 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertFlattenV9 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertGatherV1 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertGemmV1 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertGemmV6 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertGemmV7 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertGemmV9 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertGemmV11 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertGlobalAveragePoolV2 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertGreaterV7 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertGreaterV9 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertIdentityV1 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertLessV7 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertLessV9 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertMatMulV1 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertMatMulV9 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertMaxV1 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertMaxV6 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertMaxV8 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertMaxPoolV1 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertMaxPoolV8 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertMaxPoolV10 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertMulV7 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertPadAttrName (const std::string &pad_attr_name, const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertPadV1 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertPadV2 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertReciprocalV1 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertReciprocalV6 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertReduceMeanV1 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertReluV1 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertReluV6 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertReshapeV1 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertReshapeV5 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertShapeV1 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertSigmoidV1 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertSigmoidV6 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertSoftmaxV1 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertSqrtV1 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertSqrtV6 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertSubV1 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertSubV6 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertSubV7 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertSumV8 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertTanhV1 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertTanhV6 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertTransposeV1 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertUnsqueezeV1 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertUpsampleV1 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertUpsampleV7 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
void | convertUpsampleV9 (const onnx::NodeProto &onnx_node, ConverterContext *context) |
Variables | |
const int64_t | firstUnknownOpset = 13 |
mir::Shape mir_onnx::constantToShape | ( | const mir::ops::ConstantOp * | op | ) |
Definition at line 48 of file ONNXHelpers.cpp.
References mir::TensorVariant::getElementType(), and mir::ops::ConstantOp::getValue().
Referenced by convertExpandV8().
void mir_onnx::convertAbsV1 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
void mir_onnx::convertAbsV6 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
void mir_onnx::convertAddV1 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 27 of file Add.cpp.
References convertAddV6().
void mir_onnx::convertAddV6 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 33 of file Add.cpp.
References convertAddV7(), and findAttribute().
Referenced by convertAddV1().
void mir_onnx::convertAddV7 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 43 of file Add.cpp.
References mir_onnx::ConverterContext::getGraph(), mir_onnx::ConverterContext::getNodeInputs(), and mir_onnx::ConverterContext::setNodeOutputs().
Referenced by convertAddV6().
void mir_onnx::convertAveragePoolV1 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 28 of file AveragePool.cpp.
References mir::AvgPool2DOpAttributes::data_format, findAttribute(), getAttributeValue(), mir_onnx::ConverterContext::getGraph(), mir_onnx::ConverterContext::getNodeInputs(), mir::AvgPool2DOpAttributes::include_pad, inferAutoPadding(), mir::NCHW, mir::AvgPool2DOpAttributes::padding_after, mir::AvgPool2DOpAttributes::padding_before, mir_onnx::ConverterContext::setNodeOutputs(), mir::AvgPool2DOpAttributes::strides, and mir::AvgPool2DOpAttributes::window.
Referenced by convertAveragePoolV7().
void mir_onnx::convertAveragePoolV10 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 90 of file AveragePool.cpp.
References convertAveragePoolV7().
void mir_onnx::convertAveragePoolV7 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 81 of file AveragePool.cpp.
References convertAveragePoolV1().
Referenced by convertAveragePoolV10().
void mir_onnx::convertBatchNormalizationV1 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 35 of file BatchNormalization.cpp.
References convertBatchNormalizationV6().
void mir_onnx::convertBatchNormalizationV6 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 41 of file BatchNormalization.cpp.
References convertBatchNormalizationV7().
Referenced by convertBatchNormalizationV1().
void mir_onnx::convertBatchNormalizationV7 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 50 of file BatchNormalization.cpp.
References convertBatchNormalizationV9().
Referenced by convertBatchNormalizationV6().
void mir_onnx::convertBatchNormalizationV9 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 57 of file BatchNormalization.cpp.
References mir::Tensor< T >::at(), mir::Shape::dim(), mir_onnx::ConverterContext::getGraph(), mir_onnx::ConverterContext::getNodeInputs(), mir::Tensor< T >::getShape(), mir::Shape::rank(), and mir_onnx::ConverterContext::setNodeOutputs().
Referenced by convertBatchNormalizationV7().
void mir_onnx::convertConcatV1 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 27 of file Concat.cpp.
References mir_onnx::ConverterContext::getGraph(), mir_onnx::ConverterContext::getNodeInputs(), and mir_onnx::ConverterContext::setNodeOutputs().
void mir_onnx::convertConcatV4 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 39 of file Concat.cpp.
References findAttribute(), mir_onnx::ConverterContext::getGraph(), mir_onnx::ConverterContext::getNodeInputs(), and mir_onnx::ConverterContext::setNodeOutputs().
void mir_onnx::convertConstantV1 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 28 of file Constant.cpp.
References createTensor(), mir_onnx::ConverterContext::getGraph(), mir_onnx::ConverterContext::getNodeInputs(), and mir_onnx::ConverterContext::setNodeOutputs().
Referenced by convertConstantV9().
void mir_onnx::convertConstantV11 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 47 of file Constant.cpp.
References convertConstantV9(), and findAttribute().
void mir_onnx::convertConstantV9 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 41 of file Constant.cpp.
References convertConstantV1().
Referenced by convertConstantV11().
void mir_onnx::convertConvTransposeV1 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 32 of file ConvTranspose.cpp.
References mir::Deconv2DOpAttributes::data_format, findAttribute(), getAttributeValue(), mir_onnx::ConverterContext::getGraph(), mir_onnx::ConverterContext::getNodeInputs(), inferAutoPadding(), mir::NCHW, output_shape, mir::Deconv2DOpAttributes::padding_after, mir::Deconv2DOpAttributes::padding_before, mir::Deconv2DOpAttributes::padding_type, mir::ops::SameUpper, mir_onnx::ConverterContext::setNodeOutputs(), and mir::Deconv2DOpAttributes::strides.
void mir_onnx::convertConvV1 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 30 of file Conv.cpp.
References mir::Conv2DOpAttributes::data_format, findAttribute(), fixPads(), mir_onnx::ConverterContext::getGraph(), mir_onnx::ConverterContext::getNodeInputs(), inferAutoPadding(), mir::NCHW, mir::Conv2DOpAttributes::num_groups, output_shape, mir::Conv2DOpAttributes::padding_after, mir::Conv2DOpAttributes::padding_before, luci_interpreter::RuntimeShape::resize(), mir_onnx::ConverterContext::setNodeOutputs(), and mir::Conv2DOpAttributes::strides.
void mir_onnx::convertDivV7 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 27 of file Div.cpp.
References mir_onnx::ConverterContext::getGraph(), mir_onnx::ConverterContext::getNodeInputs(), and mir_onnx::ConverterContext::setNodeOutputs().
void mir_onnx::convertDropoutV1 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 24 of file Dropout.cpp.
References convertDropoutV6().
void mir_onnx::convertDropoutV10 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 44 of file Dropout.cpp.
References mir_onnx::ConverterContext::getNodeInputs(), and mir_onnx::ConverterContext::setNodeOutputs().
Referenced by convertDropoutV6(), and convertDropoutV7().
void mir_onnx::convertDropoutV6 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 30 of file Dropout.cpp.
References convertDropoutV10().
Referenced by convertDropoutV1().
void mir_onnx::convertDropoutV7 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 39 of file Dropout.cpp.
References convertDropoutV10().
void mir_onnx::convertEqualV11 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 27 of file Equal.cpp.
References mir_onnx::ConverterContext::getGraph(), mir_onnx::ConverterContext::getNodeInputs(), and mir_onnx::ConverterContext::setNodeOutputs().
Referenced by convertEqualV7().
void mir_onnx::convertEqualV7 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 37 of file Equal.cpp.
References convertEqualV11().
void mir_onnx::convertExpandV8 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 26 of file Expand.cpp.
References constantToShape(), mir_onnx::ConverterContext::getGraph(), mir_onnx::ConverterContext::getNodeInputs(), getType(), and mir_onnx::ConverterContext::setNodeOutputs().
void mir_onnx::convertFlattenV1 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 27 of file Flatten.cpp.
References mir_onnx::ConverterContext::getGraph(), mir_onnx::ConverterContext::getNodeInputs(), and mir_onnx::ConverterContext::setNodeOutputs().
Referenced by convertFlattenV9().
void mir_onnx::convertFlattenV9 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 52 of file Flatten.cpp.
References convertFlattenV1().
void mir_onnx::convertGatherV1 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 27 of file Gather.cpp.
References mir_onnx::ConverterContext::getGraph(), mir_onnx::ConverterContext::getNodeInputs(), and mir_onnx::ConverterContext::setNodeOutputs().
void mir_onnx::convertGemmV1 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
void mir_onnx::convertGemmV11 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
void mir_onnx::convertGemmV6 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
void mir_onnx::convertGemmV7 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
void mir_onnx::convertGemmV9 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
void mir_onnx::convertGlobalAveragePoolV2 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 26 of file GlobalAveragePool.cpp.
References mir::AvgPool2DOpAttributes::data_format, mir_onnx::ConverterContext::getGraph(), mir_onnx::ConverterContext::getNodeInputs(), mir::NCHW, mir_onnx::ConverterContext::setNodeOutputs(), and mir::AvgPool2DOpAttributes::window.
void mir_onnx::convertGreaterV7 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 37 of file Greater.cpp.
void mir_onnx::convertGreaterV9 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 42 of file Greater.cpp.
void mir_onnx::convertIdentityV1 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 22 of file Identity.cpp.
References mir_onnx::ConverterContext::getNodeInputs(), and mir_onnx::ConverterContext::setNodeOutputs().
void mir_onnx::convertLessV7 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
void mir_onnx::convertLessV9 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
void mir_onnx::convertMatMulV1 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 26 of file MatMul.cpp.
References mir_onnx::ConverterContext::getGraph(), mir_onnx::ConverterContext::getNodeInputs(), and mir_onnx::ConverterContext::setNodeOutputs().
Referenced by convertMatMulV9().
void mir_onnx::convertMatMulV9 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 44 of file MatMul.cpp.
References convertMatMulV1().
void mir_onnx::convertMaxPoolV1 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 28 of file MaxPool.cpp.
References mir::MaxPool2DOpAttributes::data_format, findAttribute(), getAttributeValue(), mir_onnx::ConverterContext::getGraph(), mir_onnx::ConverterContext::getNodeInputs(), inferAutoPadding(), mir::NCHW, mir::MaxPool2DOpAttributes::padding_after, mir::MaxPool2DOpAttributes::padding_before, mir_onnx::ConverterContext::setNodeOutputs(), mir::MaxPool2DOpAttributes::strides, and mir::MaxPool2DOpAttributes::window.
Referenced by convertMaxPoolV8().
void mir_onnx::convertMaxPoolV10 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 89 of file MaxPool.cpp.
References convertMaxPoolV8(), and findAttribute().
void mir_onnx::convertMaxPoolV8 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 80 of file MaxPool.cpp.
References convertMaxPoolV1().
Referenced by convertMaxPoolV10().
void mir_onnx::convertMaxV1 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
void mir_onnx::convertMaxV6 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
void mir_onnx::convertMaxV8 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
void mir_onnx::convertMulV7 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 26 of file Mul.cpp.
References mir_onnx::ConverterContext::getGraph(), mir_onnx::ConverterContext::getNodeInputs(), and mir_onnx::ConverterContext::setNodeOutputs().
void mir_onnx::convertPadAttrName | ( | const std::string & | pad_attr_name, |
const onnx::NodeProto & | onnx_node, | ||
ConverterContext * | context | ||
) |
Definition at line 27 of file Pad.cpp.
References mir_onnx::ConverterContext::getGraph(), mir_onnx::ConverterContext::getNodeInputs(), mir::PadOpAttributes::padding_after, mir::PadOpAttributes::padding_before, mir::PadOpAttributes::padding_value, and mir_onnx::ConverterContext::setNodeOutputs().
Referenced by convertPadV1(), and convertPadV2().
void mir_onnx::convertPadV1 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 60 of file Pad.cpp.
References convertPadAttrName().
void mir_onnx::convertPadV2 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 65 of file Pad.cpp.
References convertPadAttrName().
void mir_onnx::convertReciprocalV1 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 43 of file Reciprocal.cpp.
void mir_onnx::convertReciprocalV6 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 48 of file Reciprocal.cpp.
void mir_onnx::convertReduceMeanV1 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 29 of file ReduceMean.cpp.
References mir_onnx::ConverterContext::getGraph(), mir_onnx::ConverterContext::getNodeInputs(), and mir_onnx::ConverterContext::setNodeOutputs().
void mir_onnx::convertReluV1 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
void mir_onnx::convertReluV6 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
void mir_onnx::convertReshapeV1 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 31 of file Reshape.cpp.
References mir::Shape::dim(), findAttribute(), mir_onnx::ConverterContext::getGraph(), mir_onnx::ConverterContext::getNodeInputs(), mir::Shape::rank(), and mir_onnx::ConverterContext::setNodeOutputs().
void mir_onnx::convertReshapeV5 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 60 of file Reshape.cpp.
References mir::Tensor< T >::at(), mir_onnx::ConverterContext::getGraph(), mir_onnx::ConverterContext::getNodeInputs(), mir::Shape::numElements(), mir::Shape::rank(), and mir_onnx::ConverterContext::setNodeOutputs().
void mir_onnx::convertShapeV1 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 28 of file Shape.cpp.
References mir_onnx::ConverterContext::getGraph(), mir_onnx::ConverterContext::getNodeInputs(), output_shape, mir_onnx::ConverterContext::setNodeOutputs(), and size.
void mir_onnx::convertSigmoidV1 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 36 of file Sigmoid.cpp.
void mir_onnx::convertSigmoidV6 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 41 of file Sigmoid.cpp.
void mir_onnx::convertSoftmaxV1 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 27 of file Softmax.cpp.
References mir_onnx::ConverterContext::getGraph(), mir_onnx::ConverterContext::getNodeInputs(), and mir_onnx::ConverterContext::setNodeOutputs().
void mir_onnx::convertSqrtV1 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
void mir_onnx::convertSqrtV6 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
void mir_onnx::convertSubV1 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 27 of file Sub.cpp.
References convertSubV6().
void mir_onnx::convertSubV6 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 33 of file Sub.cpp.
References convertSubV7(), and findAttribute().
Referenced by convertSubV1().
void mir_onnx::convertSubV7 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 43 of file Sub.cpp.
References mir_onnx::ConverterContext::getGraph(), mir_onnx::ConverterContext::getNodeInputs(), and mir_onnx::ConverterContext::setNodeOutputs().
Referenced by convertSubV6().
void mir_onnx::convertSumV8 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 26 of file Sum.cpp.
References mir_onnx::ConverterContext::getGraph(), mir_onnx::ConverterContext::getNodeInputs(), and mir_onnx::ConverterContext::setNodeOutputs().
void mir_onnx::convertTanhV1 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
void mir_onnx::convertTanhV6 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
void mir_onnx::convertTransposeV1 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 28 of file Transpose.cpp.
References findAttribute(), mir_onnx::ConverterContext::getGraph(), mir_onnx::ConverterContext::getNodeInputs(), and mir_onnx::ConverterContext::setNodeOutputs().
void mir_onnx::convertUnsqueezeV1 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 27 of file Unsqueeze.cpp.
References mir::Shape::dim(), mir_onnx::ConverterContext::getGraph(), mir_onnx::ConverterContext::getNodeInputs(), mir::Shape::rank(), and mir_onnx::ConverterContext::setNodeOutputs().
void mir_onnx::convertUpsampleV1 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 32 of file Upsample.cpp.
References mir_onnx::ConverterContext::getGraph(), mir_onnx::ConverterContext::getNodeInputs(), mir::ops::ResizeOp::nearestNeighbor, and mir_onnx::ConverterContext::setNodeOutputs().
void mir_onnx::convertUpsampleV7 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 62 of file Upsample.cpp.
References findAttribute(), mir_onnx::ConverterContext::getGraph(), mir_onnx::ConverterContext::getNodeInputs(), mir::ops::ResizeOp::nearestNeighbor, and mir_onnx::ConverterContext::setNodeOutputs().
void mir_onnx::convertUpsampleV9 | ( | const onnx::NodeProto & | onnx_node, |
ConverterContext * | context | ||
) |
Definition at line 95 of file Upsample.cpp.
References mir_onnx::ConverterContext::getGraph(), mir_onnx::ConverterContext::getNodeInputs(), mir::ops::ResizeOp::nearestNeighbor, and mir_onnx::ConverterContext::setNodeOutputs().
mir::Operation * mir_onnx::createOp | ( | mir::Graph * | graph, |
Types &&... | args | ||
) |
Definition at line 41 of file ONNXHelpers.h.
References foldConstants().
mir::TensorVariant mir_onnx::createTensor | ( | const onnx::TensorProto * | tensor | ) |
Definition at line 106 of file ONNXHelpers.cpp.
References mir::Shape::dim(), and onnxDataTypeToMirDataType().
Referenced by convertConstantV1().
|
inline |
Definition at line 74 of file AttributeHelpers.h.
Referenced by convertAddV6(), convertAveragePoolV1(), convertConcatV4(), convertConstantV11(), convertConvTransposeV1(), convertConvV1(), convertMaxPoolV1(), convertMaxPoolV10(), convertReshapeV1(), convertSubV6(), convertTransposeV1(), convertUpsampleV7(), getAttributeValue(), and getAttributeValue().
std::vector< std::int32_t > mir_onnx::fixPads | ( | const mir::Shape & | input_shape, |
const std::vector< std::int32_t > & | pads, | ||
const std::vector< std::int32_t > & | strides, | ||
const std::vector< std::int32_t > & | dilation, | ||
const std::vector< std::int32_t > & | kernel_shape | ||
) |
Definition at line 74 of file ConvPoolHelpers.cpp.
References mir::Shape::dim().
Referenced by convertConvV1().
mir::Operation * mir_onnx::foldConstants | ( | mir::Graph * | graph, |
mir::Operation * | op | ||
) |
Definition at line 153 of file ONNXHelpers.cpp.
References mir::Operation::accept(), mir::Operation::getInputs(), mir::Operation::Output::getNode(), mir::Operation::getNumOutputs(), mir::Operation::getOutput(), and mir::Operation::getType().
Referenced by createOp().
|
inline |
Definition at line 35 of file AttributeHelpers.h.
|
inline |
Definition at line 41 of file AttributeHelpers.h.
|
inline |
Definition at line 47 of file AttributeHelpers.h.
|
inline |
Definition at line 53 of file AttributeHelpers.h.
|
inline |
Definition at line 60 of file AttributeHelpers.h.
|
inline |
Definition at line 68 of file AttributeHelpers.h.
|
delete |
Referenced by convertAveragePoolV1(), convertConvTransposeV1(), and convertMaxPoolV1().
T mir_onnx::getAttributeValue | ( | const onnx::NodeProto & | node, |
const std::string & | name | ||
) |
Definition at line 86 of file AttributeHelpers.h.
References findAttribute().
T mir_onnx::getAttributeValue | ( | const onnx::NodeProto & | node, |
const std::string & | name, | ||
T | default_value | ||
) |
Definition at line 95 of file AttributeHelpers.h.
References findAttribute().
std::unique_ptr< mir::Graph > mir_onnx::importModelFromBinaryFile | ( | const std::string & | filename | ) |
Definition at line 223 of file ONNXImporterImpl.cpp.
Referenced by loadModel(), and main().
std::unique_ptr< mir::Graph > mir_onnx::importModelFromTextFile | ( | const std::string & | filename | ) |
Definition at line 229 of file ONNXImporterImpl.cpp.
Referenced by main().
void mir_onnx::inferAutoPadding | ( | const std::string & | pad_type, |
const mir::Shape & | input_shape, | ||
const std::vector< std::int32_t > & | dilations, | ||
const std::vector< std::int32_t > & | strides, | ||
const std::vector< std::int32_t > & | window_size, | ||
std::vector< std::int32_t > & | padding_before, | ||
std::vector< std::int32_t > & | padding_after | ||
) |
Definition at line 25 of file ConvPoolHelpers.cpp.
References mir::Shape::dim().
Referenced by convertAveragePoolV1(), convertConvTransposeV1(), convertConvV1(), and convertMaxPoolV1().
std::unique_ptr< mir::Graph > mir_onnx::loadModel | ( | const std::string & | filename | ) |
Definition at line 235 of file ONNXImporterImpl.cpp.
References importModelFromBinaryFile().
Referenced by main().
mir::DataType mir_onnx::onnxDataTypeToMirDataType | ( | onnx::TensorProto::DataType | type | ) |
Definition at line 79 of file ONNXHelpers.cpp.
Referenced by createTensor().
|
inline |
Definition at line 64 of file ONNXOpRegistration.h.
References Add(), AveragePool(), Conv(), Div(), firstUnknownOpset, Gemm(), mir_onnx::NodeConverterRegistry::getInstance(), Identity, Max, MaxPool(), Mul(), REG, Relu, Softmax(), Sub(), and UNSUPPORTED.
const int64_t mir_onnx::firstUnknownOpset = 13 |
Definition at line 31 of file ONNXHelpers.cpp.
Referenced by registerSupportedOps().