HDK
|
#include <node_arg.h>
Public Member Functions | |
NodeArg (const std::string &name, const ONNX_NAMESPACE::TypeProto *p_arg_type) | |
NodeArg (NodeArg &&)=default | |
NodeArg & | operator= (NodeArg &&other)=default |
const std::string & | Name () const noexcept |
const std::string * | Type () const noexcept |
const ONNX_NAMESPACE::TypeProto * | TypeAsProto () const noexcept |
const ONNX_NAMESPACE::TensorShapeProto * | Shape () const |
bool | HasTensorOrScalarShape () const |
void | SetShape (const ONNX_NAMESPACE::TensorShapeProto &shape) |
void | ClearShape () |
common::Status | OverrideTypesHelper (const ONNX_NAMESPACE::TypeProto &input_type, int32_t input_tensor_elem_type, int32_t current_tensor_elem_type, bool override_types) |
common::Status | UpdateTypeAndShape (const ONNX_NAMESPACE::TypeProto &input_type, bool strict, bool override_types, const logging::Logger &logger) |
common::Status | UpdateTypeAndShape (const NodeArg &node_arg, bool strict, bool override_types, const logging::Logger &logger) |
const NodeArgInfo & | ToProto () const noexcept |
bool | Exists () const noexcept |
NodeArg (NodeArgInfo &&node_arg_info) | |
Friends | |
class | Graph |
Class representing a data type that is input or output for a Node, including the shape if it is a Tensor.
Definition at line 35 of file node_arg.h.
onnxruntime::NodeArg::NodeArg | ( | const std::string & | name, |
const ONNX_NAMESPACE::TypeProto * | p_arg_type | ||
) |
Construct a new NodeArg.
name | The name to use. |
p_arg_type | Optional TypeProto specifying type and shape information. |
|
default |
onnxruntime::NodeArg::NodeArg | ( | NodeArgInfo && | node_arg_info | ) |
void onnxruntime::NodeArg::ClearShape | ( | ) |
Clears shape info.
|
noexcept |
bool onnxruntime::NodeArg::HasTensorOrScalarShape | ( | ) | const |
Return an indicator.
|
noexcept |
Gets the name.
common::Status onnxruntime::NodeArg::OverrideTypesHelper | ( | const ONNX_NAMESPACE::TypeProto & | input_type, |
int32_t | input_tensor_elem_type, | ||
int32_t | current_tensor_elem_type, | ||
bool | override_types | ||
) |
Override current type from input_type if override_types is set to true, return failure status otherwise.
input_tensor_elem_type | Tensor element type parsed input_type |
current_tensor_elem_type | Tensor element type parsed from existing type |
override_types | If true, resolve the two inputs or two outputs type when different |
Sets the shape.
const ONNX_NAMESPACE::TensorShapeProto* onnxruntime::NodeArg::Shape | ( | ) | const |
|
inlinenoexcept |
Gets this NodeArg as a NodeArgInfo, AKA ValueInfoProto.
Definition at line 108 of file node_arg.h.
|
noexcept |
Gets the data type.
|
noexcept |
Gets the TypeProto
common::Status onnxruntime::NodeArg::UpdateTypeAndShape | ( | const ONNX_NAMESPACE::TypeProto & | input_type, |
bool | strict, | ||
bool | override_types, | ||
const logging::Logger & | logger | ||
) |
Validate and merge type [and shape] info from input_type.
strict | If true, the shape update will fail if there are incompatible values. If false, will be lenient and merge only shape info that can be validly processed. |
override_types | If true, resolve the two inputs or two outputs type when different |
common::Status onnxruntime::NodeArg::UpdateTypeAndShape | ( | const NodeArg & | node_arg, |
bool | strict, | ||
bool | override_types, | ||
const logging::Logger & | logger | ||
) |
Validate and merge type [and shape] info from node_arg.
strict | If true, the shape update will fail if there are incompatible values. If false, will be lenient and merge only shape info that can be validly processed. |
override_types | If true, resolve the two inputs or two outputs type when different |
Definition at line 114 of file node_arg.h.