Compute Library
 21.02
INode Class Referenceabstract

Node interface. More...

#include <INode.h>

Public Member Functions

 INode ()
 Constructor. More...
 
virtual ~INode ()=default
 Destructor. More...
 
 INode (const INode &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
INodeoperator= (const INode &)=delete
 Prevent instances of this class from being copy assigned (As this class contains pointers) More...
 
 INode (INode &&)=default
 Allow instances of this class to be moved. More...
 
INodeoperator= (INode &&)=default
 Allow instances of this class to be move assigned. More...
 
virtual Status validate () const
 Validate node. More...
 
virtual NodeType type () const =0
 Returns node's type. More...
 
virtual void accept (INodeVisitor &v)=0
 Accepts a node visitor. More...
 
virtual bool forward_descriptors ()=0
 Forwards descriptor information to outputs if possible. More...
 
virtual TensorDescriptor configure_output (size_t idx) const =0
 Calculates output configuration. More...
 
std::string name () const
 Returns node's name. More...
 
NodeID id () const
 Returns node's ID. More...
 
const Graphgraph () const
 Returns node's Graph. More...
 
Graphgraph ()
 Returns node's Graph. More...
 
void set_graph (Graph *g)
 Sets the graph that this node is registered to. More...
 
void set_id (NodeID id)
 Sets the node id. More...
 
void set_common_node_parameters (NodeParams common_params)
 Sets common node parameters. More...
 
void set_requested_target (Target target)
 Sets target preference. More...
 
void set_assigned_target (Target target)
 Sets the final execution target. More...
 
void set_output_tensor (TensorID tid, size_t idx)
 Sets the output tensor of at a given index. More...
 
const std::vector< TensorID > & inputs () const
 Returns inputs of the node. More...
 
const std::vector< TensorID > & outputs () const
 Returns outputs of the node. More...
 
const std::vector< EdgeID > & input_edges () const
 Returns input edge set. More...
 
const std::set< EdgeID > & output_edges () const
 Returns output edge set. More...
 
TensorID input_id (size_t idx) const
 Returns the tensor ID of a given input of the node. More...
 
TensorID output_id (size_t idx) const
 Returns the tensor ID of a given output of the node. More...
 
Tensorinput (size_t idx) const
 Returns the tensor of a given input of the node. More...
 
Tensoroutput (size_t idx) const
 Returns the tensor of a given output of the node. More...
 
EdgeID input_edge_id (size_t idx) const
 Returns the edge ID of a given input of the node. More...
 
Edgeinput_edge (size_t idx) const
 Returns the edge of a given input of the node. More...
 
size_t num_inputs () const
 Returns number of inputs of the node. More...
 
size_t num_outputs () const
 Returns number of outputs of the node. More...
 
NodeParams common_node_params () const
 Returns common node parameters. More...
 
Target requested_target () const
 Returns requested target for this node. More...
 
Target assigned_target () const
 Returns assigned target for this node. More...
 

Friends

class Graph
 

Detailed Description

Node interface.

Definition at line 45 of file INode.h.

Constructor & Destructor Documentation

◆ INode() [1/3]

INode ( )

Constructor.

Definition at line 37 of file INode.cpp.

References arm_compute::graph::UNSPECIFIED.

38  : _graph(nullptr), _id(EmptyNodeID), _common_params({ "", Target::UNSPECIFIED}),
39  _outputs(), _input_edges(), _output_edges(), _assigned_target(Target::UNSPECIFIED)
40 {
41 }
constexpr NodeID EmptyNodeID
Constant EdgeID specifying an equivalent of null edge.
Definition: Types.h:73

◆ ~INode()

virtual ~INode ( )
virtualdefault

Destructor.

◆ INode() [2/3]

INode ( const INode )
delete

Prevent instances of this class from being copied (As this class contains pointers)

◆ INode() [3/3]

INode ( INode &&  )
default

Allow instances of this class to be moved.

Member Function Documentation

◆ accept()

◆ assigned_target()

◆ common_node_params()

NodeParams common_node_params ( ) const

Returns common node parameters.

Returns
Common node parameters

Definition at line 188 of file INode.cpp.

189 {
190  return _common_params;
191 }

◆ configure_output()

◆ forward_descriptors()

◆ graph() [1/2]

const Graph * graph ( ) const

Returns node's Graph.

Returns
Node's graph

Definition at line 112 of file INode.cpp.

Referenced by arm_compute::graph::detail::all_inputs_are_visited(), and arm_compute::graph::get_driving_nodes().

113 {
114  return _graph;
115 }

◆ graph() [2/2]

Graph * graph ( )

Returns node's Graph.

Returns
Node's graph

Definition at line 117 of file INode.cpp.

118 {
119  return _graph;
120 }

◆ id()

NodeID id ( ) const

Returns node's ID.

Returns
Node's ID

Definition at line 102 of file INode.cpp.

Referenced by NEDeviceBackend::configure_node(), GCDeviceBackend::configure_node(), CLDeviceBackend::configure_node(), Edge::consumer_id(), arm_compute::graph::backends::detail::create_concatenate_layer(), arm_compute::graph::backends::detail::create_stack_layer(), DepthConcatSubTensorMutator::mutate(), GroupedConvolutionMutator::mutate(), SplitLayerSubTensorMutator::mutate(), NodeExecutionMethodMutator::mutate(), Edge::producer_id(), INode::set_id(), arm_compute::graph::backends::detail::validate_arg_min_max_layer(), arm_compute::graph::backends::detail::validate_bounding_box_transform_layer(), arm_compute::graph::backends::detail::validate_channel_shuffle_layer(), arm_compute::graph::backends::detail::validate_convolution_layer(), arm_compute::graph::backends::detail::validate_depth_to_space_layer(), arm_compute::graph::backends::detail::validate_depthwise_convolution_layer(), arm_compute::graph::backends::detail::validate_dequantization_layer(), arm_compute::graph::backends::detail::validate_detection_output_layer(), arm_compute::graph::backends::detail::validate_detection_post_process_layer(), arm_compute::graph::backends::detail::validate_eltwise_Layer(), arm_compute::graph::backends::detail::validate_generate_proposals_layer(), arm_compute::graph::backends::detail::validate_l2_normalize_layer(), NEDeviceBackend::validate_node(), GCDeviceBackend::validate_node(), CLDeviceBackend::validate_node(), arm_compute::graph::backends::detail::validate_node(), arm_compute::graph::backends::detail::validate_normalize_planar_yuv_layer(), arm_compute::graph::backends::detail::validate_pad_layer(), arm_compute::graph::backends::detail::validate_permute_layer(), arm_compute::graph::backends::detail::validate_prelu_layer(), arm_compute::graph::backends::detail::validate_priorbox_layer(), arm_compute::graph::backends::detail::validate_quantization_layer(), arm_compute::graph::backends::detail::validate_reduction_operation_layer(), arm_compute::graph::backends::detail::validate_reorg_layer(), arm_compute::graph::backends::detail::validate_reshape_layer(), arm_compute::graph::backends::detail::validate_roi_align_layer(), arm_compute::graph::backends::detail::validate_slice_layer(), arm_compute::graph::backends::detail::validate_strided_slice_layer(), and arm_compute::graph::backends::detail::validate_unary_eltwise_layer().

103 {
104  return _id;
105 }

◆ input()

Tensor * input ( size_t  idx) const

Returns the tensor of a given input of the node.

Note
Precondition : idx should be a valid input index
Parameters
[in]idxIndex of the node input
Returns
Tensor of the requested input

Definition at line 150 of file INode.cpp.

References ARM_COMPUTE_ERROR_ON, Graph::edge(), and Edge::tensor().

Referenced by arm_compute::graph::detail::allocate_all_input_tensors(), FlattenLayerNode::configure_output(), NormalizePlanarYUVLayerNode::configure_output(), PReluLayerNode::configure_output(), ReshapeLayerNode::configure_output(), DequantizationLayerNode::configure_output(), SoftmaxLayerNode::configure_output(), ChannelShuffleLayerNode::configure_output(), NormalizationLayerNode::configure_output(), BoundingBoxTransformLayerNode::configure_output(), GenerateProposalsLayerNode::configure_output(), DummyNode::configure_output(), ActivationLayerNode::configure_output(), PermuteLayerNode::configure_output(), QuantizationLayerNode::configure_output(), ResizeLayerNode::configure_output(), ROIAlignLayerNode::configure_output(), DepthToSpaceLayerNode::configure_output(), PadLayerNode::configure_output(), ReductionLayerNode::configure_output(), DetectionOutputLayerNode::configure_output(), PoolingLayerNode::configure_output(), PriorBoxLayerNode::configure_output(), ReorgLayerNode::configure_output(), BatchNormalizationLayerNode::configure_output(), DeconvolutionLayerNode::configure_output(), ArgMinMaxLayerNode::configure_output(), SliceLayerNode::configure_output(), PrintLayerNode::configure_output(), L2NormalizeLayerNode::configure_output(), SplitLayerNode::configure_output(), EltwiseLayerNode::configure_output(), StridedSliceLayerNode::configure_output(), FullyConnectedLayerNode::configure_output(), DepthwiseConvolutionLayerNode::configure_output(), ConvolutionLayerNode::configure_output(), UnaryEltwiseLayerNode::configure_output(), FusedDepthwiseConvolutionBatchNormalizationNode::configure_output(), FusedConvolutionBatchNormalizationNode::configure_output(), arm_compute::graph::backends::detail::create_concatenate_layer(), arm_compute::graph::backends::detail::create_stack_layer(), arm_compute::graph::execute_task(), SplitLayerSubTensorMutator::mutate(), DepthConcatSubTensorMutator::mutate(), SplitLayerNode::validate(), arm_compute::graph::backends::detail::validate_arg_min_max_layer(), arm_compute::graph::backends::detail::validate_bounding_box_transform_layer(), arm_compute::graph::backends::detail::validate_channel_shuffle_layer(), arm_compute::graph::backends::detail::validate_convolution_layer(), arm_compute::graph::backends::detail::validate_depth_to_space_layer(), arm_compute::graph::backends::detail::validate_depthwise_convolution_layer(), arm_compute::graph::backends::detail::validate_dequantization_layer(), arm_compute::graph::backends::detail::validate_detection_output_layer(), arm_compute::graph::backends::detail::validate_detection_post_process_layer(), arm_compute::graph::backends::detail::validate_eltwise_Layer(), arm_compute::graph::backends::detail::validate_generate_proposals_layer(), arm_compute::graph::backends::detail::validate_l2_normalize_layer(), arm_compute::graph::backends::detail::validate_normalize_planar_yuv_layer(), arm_compute::graph::backends::detail::validate_pad_layer(), arm_compute::graph::backends::detail::validate_permute_layer(), arm_compute::graph::backends::detail::validate_prelu_layer(), arm_compute::graph::backends::detail::validate_priorbox_layer(), arm_compute::graph::backends::detail::validate_quantization_layer(), arm_compute::graph::backends::detail::validate_reduction_operation_layer(), arm_compute::graph::backends::detail::validate_reorg_layer(), arm_compute::graph::backends::detail::validate_reshape_layer(), arm_compute::graph::backends::detail::validate_roi_align_layer(), arm_compute::graph::backends::detail::validate_slice_layer(), arm_compute::graph::backends::detail::validate_strided_slice_layer(), and arm_compute::graph::backends::detail::validate_unary_eltwise_layer().

151 {
152  ARM_COMPUTE_ERROR_ON(_graph == nullptr);
153  ARM_COMPUTE_ERROR_ON(idx >= _input_edges.size());
154  Edge *e = _graph->edge(_input_edges[idx]);
155  return (e != nullptr) ? e->tensor() : nullptr;
156 }
Tensor * tensor() const
Returns the tensor associated with this edge.
Definition: Edge.h:116
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Definition: Error.h:466
const Edge * edge(EdgeID id) const
Get edge object given its id.
Definition: Graph.cpp:214

◆ input_edge()

Edge * input_edge ( size_t  idx) const

Returns the edge of a given input of the node.

Note
Precondition : idx should be a valid input index
Parameters
[in]idxIndex of the node input
Returns
Edge of the requested input

Definition at line 171 of file INode.cpp.

References ARM_COMPUTE_ERROR_ON, and Graph::edge().

Referenced by arm_compute::graph::detail::fuse_convolution_with_batch_normalization(), and arm_compute::graph::detail::fuse_depthwise_convolution_with_batch_normalization().

172 {
173  ARM_COMPUTE_ERROR_ON(_graph == nullptr);
174  ARM_COMPUTE_ERROR_ON(idx >= _input_edges.size());
175  return _graph->edge(_input_edges[idx]);
176 }
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Definition: Error.h:466
const Edge * edge(EdgeID id) const
Get edge object given its id.
Definition: Graph.cpp:214

◆ input_edge_id()

EdgeID input_edge_id ( size_t  idx) const

Returns the edge ID of a given input of the node.

Note
Precondition : idx should be a valid input index
Parameters
[in]idxIndex of the node input
Returns
EdgeID of the requested input

Definition at line 165 of file INode.cpp.

References ARM_COMPUTE_ERROR_ON.

166 {
167  ARM_COMPUTE_ERROR_ON(idx >= _input_edges.size());
168  return _input_edges[idx];
169 }
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Definition: Error.h:466

◆ input_edges()

const std::vector< EdgeID > & input_edges ( ) const

Returns input edge set.

Returns
Set of input edges

Definition at line 127 of file INode.cpp.

Referenced by arm_compute::graph::detail::all_inputs_are_visited(), and DepthConcatSubTensorMutator::mutate().

128 {
129  return _input_edges;
130 }

◆ input_id()

TensorID input_id ( size_t  idx) const

Returns the tensor ID of a given input of the node.

Note
Precondition : idx should be a valid input index
Parameters
[in]idxIndex of the node input
Returns
TensorID of the requested input

Definition at line 137 of file INode.cpp.

References ARM_COMPUTE_ERROR_ON, Graph::edge(), arm_compute::graph::NullTensorID, and Edge::tensor_id().

Referenced by StackLayerNode::configure_output(), ConcatenateLayerNode::configure_output(), FlattenLayerNode::forward_descriptors(), NormalizePlanarYUVLayerNode::forward_descriptors(), PReluLayerNode::forward_descriptors(), ReshapeLayerNode::forward_descriptors(), DequantizationLayerNode::forward_descriptors(), SoftmaxLayerNode::forward_descriptors(), NormalizationLayerNode::forward_descriptors(), ChannelShuffleLayerNode::forward_descriptors(), DetectionPostProcessLayerNode::forward_descriptors(), GenerateProposalsLayerNode::forward_descriptors(), BoundingBoxTransformLayerNode::forward_descriptors(), ResizeLayerNode::forward_descriptors(), ActivationLayerNode::forward_descriptors(), PermuteLayerNode::forward_descriptors(), DummyNode::forward_descriptors(), QuantizationLayerNode::forward_descriptors(), ReductionLayerNode::forward_descriptors(), DepthToSpaceLayerNode::forward_descriptors(), ROIAlignLayerNode::forward_descriptors(), PadLayerNode::forward_descriptors(), ReorgLayerNode::forward_descriptors(), PriorBoxLayerNode::forward_descriptors(), DetectionOutputLayerNode::forward_descriptors(), PoolingLayerNode::forward_descriptors(), BatchNormalizationLayerNode::forward_descriptors(), DeconvolutionLayerNode::forward_descriptors(), ArgMinMaxLayerNode::forward_descriptors(), SliceLayerNode::forward_descriptors(), PrintLayerNode::forward_descriptors(), L2NormalizeLayerNode::forward_descriptors(), SplitLayerNode::forward_descriptors(), EltwiseLayerNode::forward_descriptors(), StridedSliceLayerNode::forward_descriptors(), FullyConnectedLayerNode::forward_descriptors(), DepthwiseConvolutionLayerNode::forward_descriptors(), ConvolutionLayerNode::forward_descriptors(), UnaryEltwiseLayerNode::forward_descriptors(), FusedDepthwiseConvolutionBatchNormalizationNode::forward_descriptors(), and FusedConvolutionBatchNormalizationNode::forward_descriptors().

138 {
139  ARM_COMPUTE_ERROR_ON(idx >= _input_edges.size());
140  Edge *e = _graph->edge(_input_edges[idx]);
141  return (e != nullptr) ? e->tensor_id() : NullTensorID;
142 }
TensorID tensor_id() const
Returns the tensor id associated with this edge.
Definition: Edge.h:124
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Definition: Error.h:466
const Edge * edge(EdgeID id) const
Get edge object given its id.
Definition: Graph.cpp:214
constexpr TensorID NullTensorID
Constant NodeID specifying an equivalent of null node.
Definition: Types.h:71

◆ inputs()

const std::vector<TensorID>& inputs ( ) const

Returns inputs of the node.

Returns
Inputs of the node

◆ name()

std::string name ( ) const

Returns node's name.

Returns
Node name

Definition at line 107 of file INode.cpp.

References NodeParams::name.

Referenced by arm_compute::graph::backends::detail::create_concatenate_layer(), arm_compute::graph::backends::detail::create_stack_layer(), DepthConcatSubTensorMutator::mutate(), SplitLayerSubTensorMutator::mutate(), NodeExecutionMethodMutator::mutate(), arm_compute::graph::backends::detail::validate_arg_min_max_layer(), arm_compute::graph::backends::detail::validate_bounding_box_transform_layer(), arm_compute::graph::backends::detail::validate_channel_shuffle_layer(), arm_compute::graph::backends::detail::validate_convolution_layer(), arm_compute::graph::backends::detail::validate_depth_to_space_layer(), arm_compute::graph::backends::detail::validate_depthwise_convolution_layer(), arm_compute::graph::backends::detail::validate_dequantization_layer(), arm_compute::graph::backends::detail::validate_detection_output_layer(), arm_compute::graph::backends::detail::validate_detection_post_process_layer(), arm_compute::graph::backends::detail::validate_eltwise_Layer(), arm_compute::graph::backends::detail::validate_generate_proposals_layer(), arm_compute::graph::backends::detail::validate_l2_normalize_layer(), arm_compute::graph::backends::detail::validate_node(), arm_compute::graph::backends::detail::validate_normalize_planar_yuv_layer(), arm_compute::graph::backends::detail::validate_pad_layer(), arm_compute::graph::backends::detail::validate_permute_layer(), arm_compute::graph::backends::detail::validate_prelu_layer(), arm_compute::graph::backends::detail::validate_priorbox_layer(), arm_compute::graph::backends::detail::validate_quantization_layer(), arm_compute::graph::backends::detail::validate_reduction_operation_layer(), arm_compute::graph::backends::detail::validate_reorg_layer(), arm_compute::graph::backends::detail::validate_reshape_layer(), arm_compute::graph::backends::detail::validate_roi_align_layer(), arm_compute::graph::backends::detail::validate_slice_layer(), arm_compute::graph::backends::detail::validate_strided_slice_layer(), and arm_compute::graph::backends::detail::validate_unary_eltwise_layer().

108 {
109  return _common_params.name;
110 }
std::string name
Node name.
Definition: Types.h:213

◆ num_inputs()

size_t num_inputs ( ) const

Returns number of inputs of the node.

Returns
Number of inputs

Definition at line 178 of file INode.cpp.

Referenced by arm_compute::graph::detail::allocate_all_input_tensors(), arm_compute::graph::backends::detail::create_concatenate_layer(), arm_compute::graph::backends::detail::create_stack_layer(), arm_compute::graph::backends::detail::validate_arg_min_max_layer(), arm_compute::graph::backends::detail::validate_bounding_box_transform_layer(), arm_compute::graph::backends::detail::validate_channel_shuffle_layer(), arm_compute::graph::backends::detail::validate_convolution_layer(), arm_compute::graph::backends::detail::validate_depth_to_space_layer(), arm_compute::graph::backends::detail::validate_depthwise_convolution_layer(), arm_compute::graph::backends::detail::validate_dequantization_layer(), arm_compute::graph::backends::detail::validate_detection_output_layer(), arm_compute::graph::backends::detail::validate_detection_post_process_layer(), arm_compute::graph::backends::detail::validate_eltwise_Layer(), arm_compute::graph::backends::detail::validate_generate_proposals_layer(), arm_compute::graph::backends::detail::validate_l2_normalize_layer(), arm_compute::graph::backends::detail::validate_node(), arm_compute::graph::backends::detail::validate_normalize_planar_yuv_layer(), arm_compute::graph::backends::detail::validate_pad_layer(), arm_compute::graph::backends::detail::validate_permute_layer(), arm_compute::graph::backends::detail::validate_prelu_layer(), arm_compute::graph::backends::detail::validate_priorbox_layer(), arm_compute::graph::backends::detail::validate_quantization_layer(), arm_compute::graph::backends::detail::validate_reduction_operation_layer(), arm_compute::graph::backends::detail::validate_reorg_layer(), arm_compute::graph::backends::detail::validate_reshape_layer(), arm_compute::graph::backends::detail::validate_roi_align_layer(), arm_compute::graph::backends::detail::validate_slice_layer(), arm_compute::graph::backends::detail::validate_strided_slice_layer(), and arm_compute::graph::backends::detail::validate_unary_eltwise_layer().

179 {
180  return _input_edges.size();
181 }

◆ num_outputs()

size_t num_outputs ( ) const

Returns number of outputs of the node.

Returns
Number of outputs

Definition at line 183 of file INode.cpp.

Referenced by arm_compute::graph::detail::allocate_all_output_tensors(), arm_compute::graph::backends::detail::create_concatenate_layer(), arm_compute::graph::backends::detail::create_stack_layer(), arm_compute::graph::backends::detail::validate_arg_min_max_layer(), arm_compute::graph::backends::detail::validate_bounding_box_transform_layer(), arm_compute::graph::backends::detail::validate_channel_shuffle_layer(), arm_compute::graph::backends::detail::validate_convolution_layer(), arm_compute::graph::backends::detail::validate_depth_to_space_layer(), arm_compute::graph::backends::detail::validate_depthwise_convolution_layer(), arm_compute::graph::backends::detail::validate_dequantization_layer(), arm_compute::graph::backends::detail::validate_detection_output_layer(), arm_compute::graph::backends::detail::validate_detection_post_process_layer(), arm_compute::graph::backends::detail::validate_eltwise_Layer(), arm_compute::graph::backends::detail::validate_generate_proposals_layer(), arm_compute::graph::backends::detail::validate_l2_normalize_layer(), arm_compute::graph::backends::detail::validate_node(), arm_compute::graph::backends::detail::validate_normalize_planar_yuv_layer(), arm_compute::graph::backends::detail::validate_pad_layer(), arm_compute::graph::backends::detail::validate_permute_layer(), arm_compute::graph::backends::detail::validate_prelu_layer(), arm_compute::graph::backends::detail::validate_priorbox_layer(), arm_compute::graph::backends::detail::validate_quantization_layer(), arm_compute::graph::backends::detail::validate_reduction_operation_layer(), arm_compute::graph::backends::detail::validate_reorg_layer(), arm_compute::graph::backends::detail::validate_reshape_layer(), arm_compute::graph::backends::detail::validate_roi_align_layer(), arm_compute::graph::backends::detail::validate_slice_layer(), arm_compute::graph::backends::detail::validate_strided_slice_layer(), and arm_compute::graph::backends::detail::validate_unary_eltwise_layer().

184 {
185  return _outputs.size();
186 }

◆ operator=() [1/2]

INode& operator= ( const INode )
delete

Prevent instances of this class from being copy assigned (As this class contains pointers)

◆ operator=() [2/2]

INode& operator= ( INode &&  )
default

Allow instances of this class to be move assigned.

◆ output()

Tensor * output ( size_t  idx) const

Returns the tensor of a given output of the node.

Note
Precondition : idx should be a valid output index
Parameters
[in]idxIndex of the node output
Returns
Tensor of the requested output

Definition at line 158 of file INode.cpp.

References ARM_COMPUTE_ERROR_ON, and Graph::tensor().

Referenced by arm_compute::graph::detail::allocate_all_output_tensors(), arm_compute::graph::backends::detail::create_concatenate_layer(), arm_compute::graph::backends::detail::create_stack_layer(), FlattenLayerNode::forward_descriptors(), NormalizePlanarYUVLayerNode::forward_descriptors(), PReluLayerNode::forward_descriptors(), ConstNode::forward_descriptors(), ReshapeLayerNode::forward_descriptors(), InputNode::forward_descriptors(), DequantizationLayerNode::forward_descriptors(), ChannelShuffleLayerNode::forward_descriptors(), SoftmaxLayerNode::forward_descriptors(), DetectionPostProcessLayerNode::forward_descriptors(), NormalizationLayerNode::forward_descriptors(), BoundingBoxTransformLayerNode::forward_descriptors(), GenerateProposalsLayerNode::forward_descriptors(), QuantizationLayerNode::forward_descriptors(), ResizeLayerNode::forward_descriptors(), ActivationLayerNode::forward_descriptors(), DummyNode::forward_descriptors(), PermuteLayerNode::forward_descriptors(), ReductionLayerNode::forward_descriptors(), ROIAlignLayerNode::forward_descriptors(), DepthToSpaceLayerNode::forward_descriptors(), PadLayerNode::forward_descriptors(), PriorBoxLayerNode::forward_descriptors(), ReorgLayerNode::forward_descriptors(), DetectionOutputLayerNode::forward_descriptors(), PoolingLayerNode::forward_descriptors(), StackLayerNode::forward_descriptors(), BatchNormalizationLayerNode::forward_descriptors(), DeconvolutionLayerNode::forward_descriptors(), ArgMinMaxLayerNode::forward_descriptors(), SliceLayerNode::forward_descriptors(), PrintLayerNode::forward_descriptors(), L2NormalizeLayerNode::forward_descriptors(), SplitLayerNode::forward_descriptors(), ConcatenateLayerNode::forward_descriptors(), EltwiseLayerNode::forward_descriptors(), StridedSliceLayerNode::forward_descriptors(), FullyConnectedLayerNode::forward_descriptors(), DepthwiseConvolutionLayerNode::forward_descriptors(), ConvolutionLayerNode::forward_descriptors(), UnaryEltwiseLayerNode::forward_descriptors(), FusedDepthwiseConvolutionBatchNormalizationNode::forward_descriptors(), FusedConvolutionBatchNormalizationNode::forward_descriptors(), NodeFusionMutator::mutate(), GroupedConvolutionMutator::mutate(), SplitLayerSubTensorMutator::mutate(), DepthConcatSubTensorMutator::mutate(), arm_compute::graph::backends::detail::validate_arg_min_max_layer(), arm_compute::graph::backends::detail::validate_bounding_box_transform_layer(), arm_compute::graph::backends::detail::validate_channel_shuffle_layer(), arm_compute::graph::backends::detail::validate_convolution_layer(), arm_compute::graph::backends::detail::validate_depth_to_space_layer(), arm_compute::graph::backends::detail::validate_depthwise_convolution_layer(), arm_compute::graph::backends::detail::validate_dequantization_layer(), arm_compute::graph::backends::detail::validate_detection_output_layer(), arm_compute::graph::backends::detail::validate_detection_post_process_layer(), arm_compute::graph::backends::detail::validate_eltwise_Layer(), arm_compute::graph::backends::detail::validate_generate_proposals_layer(), arm_compute::graph::backends::detail::validate_l2_normalize_layer(), arm_compute::graph::backends::detail::validate_normalize_planar_yuv_layer(), arm_compute::graph::backends::detail::validate_pad_layer(), arm_compute::graph::backends::detail::validate_permute_layer(), arm_compute::graph::backends::detail::validate_prelu_layer(), arm_compute::graph::backends::detail::validate_priorbox_layer(), arm_compute::graph::backends::detail::validate_quantization_layer(), arm_compute::graph::backends::detail::validate_reduction_operation_layer(), arm_compute::graph::backends::detail::validate_reorg_layer(), arm_compute::graph::backends::detail::validate_reshape_layer(), arm_compute::graph::backends::detail::validate_roi_align_layer(), arm_compute::graph::backends::detail::validate_slice_layer(), arm_compute::graph::backends::detail::validate_strided_slice_layer(), and arm_compute::graph::backends::detail::validate_unary_eltwise_layer().

159 {
160  ARM_COMPUTE_ERROR_ON(_graph == nullptr);
161  ARM_COMPUTE_ERROR_ON(idx >= _outputs.size());
162  return _graph->tensor(_outputs[idx]);
163 }
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Definition: Error.h:466
const Tensor * tensor(TensorID id) const
Get tensor object given its id.
Definition: Graph.cpp:224

◆ output_edges()

const std::set< EdgeID > & output_edges ( ) const

Returns output edge set.

Returns
Set of output edges

Definition at line 132 of file INode.cpp.

Referenced by arm_compute::graph::bfs(), arm_compute::graph::dfs(), and arm_compute::graph::get_driving_nodes().

133 {
134  return _output_edges;
135 }

◆ output_id()

TensorID output_id ( size_t  idx) const

Returns the tensor ID of a given output of the node.

Note
Precondition : idx should be a valid output index
Parameters
[in]idxIndex of the node output
Returns
TensorID of the requested output

Definition at line 144 of file INode.cpp.

References ARM_COMPUTE_ERROR_ON.

Referenced by FlattenLayerNode::forward_descriptors(), NormalizePlanarYUVLayerNode::forward_descriptors(), PReluLayerNode::forward_descriptors(), ConstNode::forward_descriptors(), ReshapeLayerNode::forward_descriptors(), InputNode::forward_descriptors(), DequantizationLayerNode::forward_descriptors(), SoftmaxLayerNode::forward_descriptors(), ChannelShuffleLayerNode::forward_descriptors(), DetectionPostProcessLayerNode::forward_descriptors(), NormalizationLayerNode::forward_descriptors(), GenerateProposalsLayerNode::forward_descriptors(), BoundingBoxTransformLayerNode::forward_descriptors(), QuantizationLayerNode::forward_descriptors(), ResizeLayerNode::forward_descriptors(), ActivationLayerNode::forward_descriptors(), PermuteLayerNode::forward_descriptors(), DummyNode::forward_descriptors(), DepthToSpaceLayerNode::forward_descriptors(), ReductionLayerNode::forward_descriptors(), ROIAlignLayerNode::forward_descriptors(), PadLayerNode::forward_descriptors(), ReorgLayerNode::forward_descriptors(), DetectionOutputLayerNode::forward_descriptors(), PoolingLayerNode::forward_descriptors(), PriorBoxLayerNode::forward_descriptors(), BatchNormalizationLayerNode::forward_descriptors(), DeconvolutionLayerNode::forward_descriptors(), ArgMinMaxLayerNode::forward_descriptors(), PrintLayerNode::forward_descriptors(), SliceLayerNode::forward_descriptors(), L2NormalizeLayerNode::forward_descriptors(), SplitLayerNode::forward_descriptors(), EltwiseLayerNode::forward_descriptors(), StridedSliceLayerNode::forward_descriptors(), FullyConnectedLayerNode::forward_descriptors(), DepthwiseConvolutionLayerNode::forward_descriptors(), ConvolutionLayerNode::forward_descriptors(), UnaryEltwiseLayerNode::forward_descriptors(), FusedDepthwiseConvolutionBatchNormalizationNode::forward_descriptors(), and FusedConvolutionBatchNormalizationNode::forward_descriptors().

145 {
146  ARM_COMPUTE_ERROR_ON(idx >= _outputs.size());
147  return _outputs[idx];
148 }
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Definition: Error.h:466

◆ outputs()

◆ requested_target()

Target requested_target ( ) const

Returns requested target for this node.

Returns
Requested execution target

Definition at line 193 of file INode.cpp.

References NodeParams::target.

194 {
195  return _common_params.target;
196 }
Target target
Node target.
Definition: Types.h:214

◆ set_assigned_target()

void set_assigned_target ( Target  target)

Sets the final execution target.

Note
GraphManager might change this target
Parameters
[in]targetFinal execution target

Definition at line 71 of file INode.cpp.

72 {
73  _assigned_target = target;
74 }

◆ set_common_node_parameters()

void set_common_node_parameters ( NodeParams  common_params)

Sets common node parameters.

Parameters
[in]common_paramsCommon node parameters to set

Definition at line 61 of file INode.cpp.

Referenced by GraphEdsr::setup().

62 {
63  _common_params = std::move(common_params);
64 }

◆ set_graph()

void set_graph ( Graph g)

Sets the graph that this node is registered to.

Parameters
[in]gBack reference to graph

Definition at line 50 of file INode.cpp.

References ARM_COMPUTE_ERROR_ON.

Referenced by Graph::add_node().

51 {
52  ARM_COMPUTE_ERROR_ON(g == nullptr);
53  _graph = g;
54 }
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Definition: Error.h:466

◆ set_id()

void set_id ( NodeID  id)

Sets the node id.

Parameters
[in]idNode id

Definition at line 56 of file INode.cpp.

References INode::id().

Referenced by Graph::add_node().

57 {
58  _id = id;
59 }
NodeID id() const
Returns node&#39;s ID.
Definition: INode.cpp:102

◆ set_output_tensor()

void set_output_tensor ( TensorID  tid,
size_t  idx 
)

Sets the output tensor of at a given index.

Note
All edges will get updated
Parameters
[in]tidTensor ID
[in]idxOutput index

Definition at line 76 of file INode.cpp.

References ARM_COMPUTE_ERROR_ON, Tensor::bind_edge(), Graph::edge(), arm_compute::graph::NullTensorID, Edge::tensor(), Graph::tensor(), and Tensor::unbind_edge().

77 {
78  if(tid != NullTensorID && (idx < _outputs.size()) && (_graph->tensor(tid) != nullptr))
79  {
80  ARM_COMPUTE_ERROR_ON(_graph == nullptr);
81  Tensor *updated_tensor = _graph->tensor(tid);
82  _outputs[idx] = tid;
83 
84  // Set tensor to all output edges of the node
85  for(auto &output_edge_id : _output_edges)
86  {
87  auto output_edge = _graph->edge(output_edge_id);
88  if(output_edge != nullptr)
89  {
90  // Unbind edge from current tensor
91  auto current_output_tensor = output_edge->tensor();
92  current_output_tensor->unbind_edge(output_edge->id());
93 
94  // Update tensor to edge and rebind tensor
95  output_edge->update_bound_tensor(updated_tensor);
96  updated_tensor->bind_edge(output_edge->id());
97  }
98  }
99  }
100 }
Tensor * tensor() const
Returns the tensor associated with this edge.
Definition: Edge.h:116
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Definition: Error.h:466
void unbind_edge(EdgeID eid)
Unbinds an edge from a tensor.
Definition: Tensor.cpp:106
const Edge * edge(EdgeID id) const
Get edge object given its id.
Definition: Graph.cpp:214
constexpr TensorID NullTensorID
Constant NodeID specifying an equivalent of null node.
Definition: Types.h:71
const Tensor * tensor(TensorID id) const
Get tensor object given its id.
Definition: Graph.cpp:224

◆ set_requested_target()

void set_requested_target ( Target  target)

Sets target preference.

Note
This is not the target that the graph executor might choose, its just an indication
Parameters
[in]targetTarget preference

Definition at line 66 of file INode.cpp.

References NodeParams::target.

67 {
68  _common_params.target = target;
69 }
Target target
Node target.
Definition: Types.h:214

◆ type()

virtual NodeType type ( ) const
pure virtual

◆ validate()

Status validate ( ) const
virtual

Validate node.

Returns
Status containing any errors

Reimplemented in SplitLayerNode.

Definition at line 45 of file INode.cpp.

46 {
47  return Status{};
48 }

Friends And Related Function Documentation

◆ Graph

friend class Graph
friend

Definition at line 245 of file INode.h.


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