#include <node_arg.h>
|
| 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) |
|
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.
- Parameters
-
name | The name to use. |
p_arg_type | Optional TypeProto specifying type and shape information. |
onnxruntime::NodeArg::NodeArg |
( |
NodeArg && |
| ) |
|
|
default |
onnxruntime::NodeArg::NodeArg |
( |
NodeArgInfo && |
node_arg_info | ) |
|
void onnxruntime::NodeArg::ClearShape |
( |
| ) |
|
bool onnxruntime::NodeArg::Exists |
( |
| ) |
const |
|
noexcept |
Gets a flag indicating whether this NodeArg exists or not. Optional inputs are allowed in ONNX and an empty Name represents a non-existent input argument.
bool onnxruntime::NodeArg::HasTensorOrScalarShape |
( |
| ) |
const |
Return an indicator.
- Returns
- true if NodeArg is a normal tensor with a non-empty shape or a scalar with an empty shape. Otherwise, returns false.
const std::string& onnxruntime::NodeArg::Name |
( |
| ) |
const |
|
noexcept |
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.
- Parameters
-
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 |
- Returns
- Success unless there is existing type or shape info that can't be successfully updated.
void onnxruntime::NodeArg::SetShape |
( |
const ONNX_NAMESPACE::TensorShapeProto & |
shape | ) |
|
const ONNX_NAMESPACE::TensorShapeProto* onnxruntime::NodeArg::Shape |
( |
| ) |
const |
Gets the shape if NodeArg is for a Tensor.
- Returns
- TensorShapeProto if shape is set. nullptr if there's no shape specified.
const NodeArgInfo& onnxruntime::NodeArg::ToProto |
( |
| ) |
const |
|
inlinenoexcept |
const std::string* onnxruntime::NodeArg::Type |
( |
| ) |
const |
|
noexcept |
const ONNX_NAMESPACE::TypeProto* onnxruntime::NodeArg::TypeAsProto |
( |
| ) |
const |
|
noexcept |
Gets the TypeProto
- Returns
- TypeProto if type is set. nullptr otherwise.
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.
- Parameters
-
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 |
- Returns
- Success unless there is existing type or shape info that can't be successfully updated.
Validate and merge type [and shape] info from node_arg.
- Parameters
-
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 |
- Returns
- Success unless there is existing type or shape info that can't be successfully updated.
The documentation for this class was generated from the following file: