24.02.1
|
Go to the documentation of this file.
42 return "DepthConcatSubTensorMutator";
59 std::vector<NodeID> topological_sorted_node_ids =
dfs(g);
68 auto output_tensor = node->
output(0);
71 auto *concat_node = arm_compute::utils::cast::polymorphic_downcast<ConcatenateLayerNode *>(node);
72 if (output_tensor ==
nullptr ||
73 get_dimension_idx(output_tensor->desc().layout, concat_node->concatenation_axis()) < 2)
83 return (g.edge(eid) != nullptr) && (g.edge(eid)->tensor() != nullptr) &&
84 (g.edge(eid)->tensor()->desc().target == output_tensor->desc().target) &&
85 (g.edge(eid)->tensor()->desc().quant_info == output_tensor->desc().quant_info);
92 << node->
id() <<
" and name : " << node->
name() << std::endl);
95 for (
unsigned int i = 0; i < node->
input_edges().size(); ++i)
97 auto input_tensor = node->
input(i);
98 const auto input_shape = input_tensor->desc().shape;
102 std::unique_ptr<ITensorHandle> handle =
104 input_tensor->set_handle(std::move(handle));
109 auto *dc_node = arm_compute::utils::cast::polymorphic_downcast<ConcatenateLayerNode *>(node);
110 dc_node->set_enabled(
false);
virtual void mutate(Graph &g) override
Walk the graph and perform a specific mutation.
MutationType
Mutation type.
reverse_iterable< T > reverse_iterate(T &val)
Creates a reverse iterable for a given type.
Device backend interface.
Tensor * output(size_t idx) const
Returns the tensor of a given output of the node.
#define ARM_COMPUTE_LOG_GRAPH_VERBOSE(x)
T z() const
Alias to access the size of the third dimension.
std::string name() const
Returns node's name.
std::vector< NodeID > dfs(Graph &g)
Depth first search traversal.
bool is_target_supported(Target target)
Checks if a specific target is supported.
@ Backend
IR specific mutation.
TensorShape input_shape
Validate test suite is to test ARM_COMPUTE_RETURN_ON_* macros we use to check the validity of given a...
virtual NodeType type() const =0
Returns node's type.
const std::vector< EdgeID > & input_edges() const
Returns input edge set.
const INode * node(NodeID id) const
Get node object given its id.
const char * name() override
Returns mutator name.
virtual std::unique_ptr< ITensorHandle > create_subtensor(ITensorHandle *parent, TensorShape shape, Coordinates coords, bool extend_parent)=0
Create a backend Sub-Tensor.
size_t get_dimension_idx(DataLayout data_layout, const DataLayoutDimension data_layout_dimension)
Get index of a tensor's given dimension depending on its layout.
MutationType type() const override
Returns mutation type.
Copyright (c) 2017-2024 Arm Limited.
Tensor * input(size_t idx) const
Returns the tensor of a given input of the node.
IDeviceBackend & get_backend(Target target)
Get a backend from the registry.
NodeID id() const
Returns node's ID.
const std::vector< NodeID > & nodes(NodeType type)
Returns graph input nodes.
static BackendRegistry & get()
Gets backend registry instance.