23.11
|
Split Layer node. More...
#include <SplitLayerNode.h>
Public Member Functions | |
SplitLayerNode (unsigned int num_splits, int axis=0, std::vector< int > size_splits=std::vector< int >()) | |
Default Constructor. More... | |
std::pair< TensorDescriptor, Coordinates > | compute_output_descriptor (const TensorDescriptor &input_descriptor, unsigned int num_splits, int axis, unsigned int idx) |
Computes split layer output descriptor. More... | |
unsigned int | num_splits () const |
Number of splits accessor. More... | |
unsigned int | axis () const |
Split axis accessor. More... | |
Status | validate () const override |
Validate node. More... | |
NodeType | type () const override |
Returns node's type. More... | |
bool | forward_descriptors () override |
Forwards descriptor information to outputs if possible. More... | |
TensorDescriptor | configure_output (size_t idx) const override |
Calculates output configuration. More... | |
void | accept (INodeVisitor &v) override |
Accepts a node visitor. More... | |
![]() | |
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... | |
INode & | operator= (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... | |
INode & | operator= (INode &&)=default |
Allow instances of this class to be move assigned. More... | |
std::string | name () const |
Returns node's name. More... | |
NodeID | id () const |
Returns node's ID. More... | |
const Graph * | graph () const |
Returns node's Graph. More... | |
Graph * | graph () |
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... | |
Tensor * | input (size_t idx) const |
Returns the tensor of a given input of the node. More... | |
Tensor * | output (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... | |
Edge * | input_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... | |
Split Layer node.
Definition at line 36 of file SplitLayerNode.h.
SplitLayerNode | ( | unsigned int | num_splits, |
int | axis = 0 , |
||
std::vector< int > | size_splits = std::vector<int>() |
||
) |
Default Constructor.
[in] | num_splits | Number of splits |
[in] | axis | (Optional) Axis to split on. Defaults to 0 |
[in] | size_splits | (Optional) The sizes of each output tensor along the split dimension. Must sum to the dimension of value along split_dim. Can contain one -1 indicating that dimension is to be inferred. |
Definition at line 35 of file SplitLayerNode.cpp.
References arm_compute::graph::EmptyEdgeID, arm_compute::graph::NullTensorID, and SplitLayerNode::num_splits().
|
overridevirtual |
Accepts a node visitor.
[in] | v | Visitor to accept |
Implements INode.
Definition at line 154 of file SplitLayerNode.cpp.
References INodeVisitor::visit().
unsigned int axis | ( | ) | const |
Split axis accessor.
Definition at line 47 of file SplitLayerNode.cpp.
Referenced by SplitLayerNode::compute_output_descriptor().
std::pair< TensorDescriptor, Coordinates > compute_output_descriptor | ( | const TensorDescriptor & | input_descriptor, |
unsigned int | num_splits, | ||
int | axis, | ||
unsigned int | idx | ||
) |
Computes split layer output descriptor.
[in] | input_descriptor | Descriptor of the input tensor |
[in] | num_splits | Number of splits |
[in] | axis | Axis to perform the split on |
[in] | idx | Index of the split |
Definition at line 52 of file SplitLayerNode.cpp.
References SplitLayerNode::axis(), Dimensions< T >::num_dimensions(), SplitLayerNode::num_splits(), Dimensions< T >::set(), TensorShape::set(), TensorDescriptor::shape, and arm_compute::wrap_around().
|
overridevirtual |
Calculates output configuration.
[in] | idx | Output index to configure |
Implements INode.
Definition at line 104 of file SplitLayerNode.cpp.
References ARM_COMPUTE_ERROR_ON, ARM_COMPUTE_UNUSED, INode::input(), TensorShape::set(), TensorDescriptor::shape, arm_compute::test::validation::src, and arm_compute::wrap_around().
Referenced by SplitLayerNode::forward_descriptors().
|
overridevirtual |
Forwards descriptor information to outputs if possible.
Implements INode.
Definition at line 85 of file SplitLayerNode.cpp.
References ARM_COMPUTE_ERROR_ON, SplitLayerNode::configure_output(), Tensor::desc(), INode::input_id(), arm_compute::graph::NullTensorID, INode::output(), INode::output_id(), and SplitLayerNode::validate().
unsigned int num_splits | ( | ) | const |
Number of splits accessor.
Definition at line 42 of file SplitLayerNode.cpp.
Referenced by SplitLayerNode::compute_output_descriptor(), and SplitLayerNode::SplitLayerNode().
|
overridevirtual |
Returns node's type.
Implements INode.
Definition at line 149 of file SplitLayerNode.cpp.
References arm_compute::graph::SplitLayer.
|
overridevirtual |
Validate node.
Reimplemented from INode.
Definition at line 131 of file SplitLayerNode.cpp.
References ARM_COMPUTE_RETURN_ERROR_ON, ARM_COMPUTE_RETURN_ERROR_ON_MSG, INode::input(), arm_compute::test::validation::src, and arm_compute::wrap_around().
Referenced by SplitLayerNode::forward_descriptors().