#include <graph_viewer.h>
Class that provides a read-only view of the Graph.
Definition at line 27 of file graph_viewer.h.
onnxruntime::GraphViewer::GraphViewer |
( |
const Graph & |
graph | ) |
|
|
explicit |
bool onnxruntime::GraphViewer::CanOverrideInitializer |
( |
| ) |
const |
|
noexcept |
Returns true if an initializer value can be overridden by a graph input with the same name.
const std::string& onnxruntime::GraphViewer::Description |
( |
| ) |
const |
|
noexcept |
Gets the Graph description.
const std::unordered_map<std::string, int>& onnxruntime::GraphViewer::DomainToVersionMap |
( |
| ) |
const |
|
inlinenoexcept |
Gets the map of operator domains to their opset versions.
Definition at line 136 of file graph_viewer.h.
Gets all tensors created from initializers.
const ONNX_NAMESPACE::TensorProto* onnxruntime::GraphViewer::GetConstantInitializer |
( |
const std::string & |
name, |
|
|
bool |
check_outer_scope |
|
) |
| const |
returns the initializer's TensorProto if 'name' is an initializer, is constant and cannot be overridden at runtime. If the initializer is not found or is not constant, a nullptr is returned.
- Parameters
-
check_outer_scope | If true and the graph is a subgraph, check ancestor graph/s for 'name' if not found in 'graph'. |
std::vector<const Node*> onnxruntime::GraphViewer::GetConsumerNodes |
( |
const std::string & |
node_arg_name | ) |
const |
|
inline |
Get the filter info that restricts the graph viewer to a subset of nodes if set.
- Returns
- Filter info or nullptr
Definition at line 188 of file graph_viewer.h.
const Graph& onnxruntime::GraphViewer::GetGraph |
( |
| ) |
const |
|
inline |
bool onnxruntime::GraphViewer::GetInitializedTensor |
( |
const std::string & |
tensor_name, |
|
|
const ONNX_NAMESPACE::TensorProto *& |
value |
|
) |
| const |
Gets a tensor created from an initializer.
- Parameters
-
| tensor_name | The tensor name |
[out] | value | Sets the pointer to the TensorProto if found, or nullptr if not. |
- Returns
- True if found. False if not.
const std::vector<const NodeArg*>& onnxruntime::GraphViewer::GetInputs |
( |
| ) |
const |
|
noexcept |
Gets the Graph inputs, excluding initializers.
- Returns
- Collection of NodeArg pointers for the graph inputs, excluding inputs that have matching initializers.
const std::vector<const NodeArg*>& onnxruntime::GraphViewer::GetInputsIncludingInitializers |
( |
| ) |
const |
|
noexcept |
Gets the Graph inputs, including any initializers.
- Returns
- Collection of NodeArg pointers for all the graph inputs.
const Node* onnxruntime::GraphViewer::GetNode |
( |
NodeIndex |
node_index | ) |
const |
Gets the Node instance at the specified index.
- Parameters
-
node_index | Index to retrieve Node from. |
Gets the NodeArg instance for the given name.
- Returns
- A NodeArg if found, a nullptr if not.
const std::vector<NodeIndex>& onnxruntime::GraphViewer::GetNodesInTopologicalOrder |
( |
ExecutionOrder |
order = ExecutionOrder::DEFAULT | ) |
const |
Gets the NodeIndex values for the Graph nodes, sorted into topological order.
const std::unordered_set<std::string>& onnxruntime::GraphViewer::GetOuterScopeNodeArgNames |
( |
| ) |
const |
|
noexcept |
const std::vector<const NodeArg*>& onnxruntime::GraphViewer::GetOutputs |
( |
| ) |
const |
|
noexcept |
const Node* onnxruntime::GraphViewer::GetProducerNode |
( |
const std::string & |
node_arg_name | ) |
const |
|
inline |
const std::vector<NodeIndex>& onnxruntime::GraphViewer::GetRootNodes |
( |
| ) |
const |
Gets the NodeIndex values for the root nodes in the Graph. The root nodes are the topmost nodes in the Graph that receive inputs from the Graph inputs and no other nodes in the Graph.
const std::unordered_set<const NodeArg*>& onnxruntime::GraphViewer::GetValueInfo |
( |
| ) |
const |
|
noexcept |
bool onnxruntime::GraphViewer::IsConstantInitializer |
( |
const std::string & |
name, |
|
|
bool |
check_outer_scope |
|
) |
| const |
returns true if 'name' is an initializer, and is constant and cannot be overridden at runtime.
- Parameters
-
check_outer_scope | If true and the 'graph_' is a subgraph, check parent graph/s for 'name' if the name is not found in 'graph_'. |
bool onnxruntime::GraphViewer::IsInitializedTensor |
( |
const std::string & |
name | ) |
const |
Check if a given name is an initializer tensor's name in this graph.
bool onnxruntime::GraphViewer::IsSubgraph |
( |
| ) |
const |
Checks if this is a Subgraph
int onnxruntime::GraphViewer::MaxNodeIndex |
( |
| ) |
const |
|
noexcept |
Gets the maximum NodeIndex value used by Nodes in the Graph.
const Path& onnxruntime::GraphViewer::ModelPath |
( |
| ) |
const |
|
inlinenoexcept |
Gets the path of the owning model if any
Definition at line 46 of file graph_viewer.h.
const std::string& onnxruntime::GraphViewer::Name |
( |
| ) |
const |
|
noexcept |
bool onnxruntime::GraphViewer::NodeProducesGraphOutput |
( |
const Node & |
node | ) |
const |
Returns true if one or more of the Node outputs are Graph outputs.
Gets an iterator over all the valid Nodes in the Graph.
int onnxruntime::GraphViewer::NumberOfNodes |
( |
| ) |
const |
|
noexcept |
Gets the number of valid nodes in the Graph.
const Node* onnxruntime::GraphViewer::ParentNode |
( |
| ) |
const |
|
inlinenoexcept |
Get the Node containing this Graph if IsSubgraph is true. Returns nullptr otherwise.
Definition at line 171 of file graph_viewer.h.
The documentation for this class was generated from the following file: