From 6f92c8e9f8bb38dcf5dccf8deeff5112ecd8e37c Mon Sep 17 00:00:00 2001 From: Nikhil Raj Date: Wed, 22 Nov 2023 11:41:15 +0000 Subject: Update Doxygen for 23.11 Signed-off-by: Nikhil Raj Change-Id: I47cd933f5002cb94a73aa97689d7b3d9c93cb849 --- 23.11/_reshape_operator_8hpp.html | 246 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 246 insertions(+) create mode 100644 23.11/_reshape_operator_8hpp.html (limited to '23.11/_reshape_operator_8hpp.html') diff --git a/23.11/_reshape_operator_8hpp.html b/23.11/_reshape_operator_8hpp.html new file mode 100644 index 0000000000..3430971b95 --- /dev/null +++ b/23.11/_reshape_operator_8hpp.html @@ -0,0 +1,246 @@ + + + + + + + + +Arm NN: src/backends/tosaCommon/operatorMappings/ReshapeOperator.hpp File Reference + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  23.11 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
ReshapeOperator.hpp File Reference
+
+
+
#include "TosaOperatorUtils.hpp"
+#include <Layer.hpp>
+#include <tosa_serialization_handler.h>
+
+Include dependency graph for ReshapeOperator.hpp:
+
+
+
+
+
+This graph shows which files directly or indirectly include this file:
+
+
+
+
+
+

Go to the source code of this file.

+ + + + +

+Functions

TosaSerializationBasicBlock * ConvertReshapeToTosaOperator (const Layer *layer, const std::vector< const TensorInfo * > &inputs, const std::vector< const TensorInfo * > &outputs, const ReshapeDescriptor *reshapeDescriptor)
 
+

Function Documentation

+ +

◆ ConvertReshapeToTosaOperator()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TosaSerializationBasicBlock* ConvertReshapeToTosaOperator (const Layerlayer,
const std::vector< const TensorInfo * > & inputs,
const std::vector< const TensorInfo * > & outputs,
const ReshapeDescriptorreshapeDescriptor 
)
+
+ +

Definition at line 8 of file ReshapeOperator.cpp.

+
12 {
+
13  std::string inputName = std::string("input0_");
+
14  std::string outputName = std::string("output0_");
+
15  std::string blockName = std::string("Op_RESHAPE_block_") + GetUniqueTosaMappingID();
+
16 
+
17  // If a layer is present then the block will be used for execution, so input and output names need to be determined
+
18  // using the previous and following layers so the graph is connected correctly. For validation this doesn't matter.
+
19  if(layer != nullptr)
+
20  {
+
21  // Get the layers connected to the input slots and determine unique tensor names.
+
22  Layer& connectedLayer = layer->GetInputSlot(0).GetConnectedOutputSlot()->GetOwningLayer();
+
23  inputName = GenerateUniqueName(connectedLayer, 0);
+
24 
+
25  // Determine unique output tensor name.
+
26  outputName = GenerateUniqueOutputName(*layer, 0);
+
27  }
+
28 
+
29  TosaReshapeAttribute attribute(GetTosaTensorShape(reshapeDescriptor->m_TargetShape));
+
30 
+
31  auto* op = new TosaSerializationOperator(Op_RESHAPE,
+
32  Attribute_ReshapeAttribute,
+
33  &attribute,
+
34  {inputName},
+
35  {outputName});
+
36 
+
37  std::vector<TosaSerializationTensor*> tensors;
+
38 
+
39  // Only add input tensors if connected layer is an input layer.
+
40  // As intermediate or constant tensors will be created separately.
+
41  // There also can't be duplicate tensor.
+
42  if(inputName.find("input0_") != std::string::npos)
+
43  {
+
44  std::vector<int32_t> inputShape = GetTosaTensorShape(inputs[0]->GetShape());
+
45  DType inputDType = ArmNNToDType(inputs[0]->GetDataType());
+
46 
+
47  tensors.push_back(new TosaSerializationTensor(inputName, inputShape, inputDType, {}));
+
48  }
+
49 
+
50  std::vector<int32_t> outputShape = GetTosaTensorShape(outputs[0]->GetShape());
+
51  DType outputDType = ArmNNToDType(outputs[0]->GetDataType());
+
52 
+
53  tensors.push_back(new TosaSerializationTensor(outputName, outputShape, outputDType, {}));
+
54 
+
55  // operatorInputNames/operatorOutputNames ends up being the same as
+
56  // blockInputNames/blockOutputNames for one-to-one ArmNN to TOSA mappings
+
57  return new TosaSerializationBasicBlock(blockName, // name
+
58  mainName, // region name
+
59  {op}, // operators
+
60  tensors, // tensors
+
61  {inputName}, // inputs
+
62  {outputName}); // outputs
+
63 }
+
+

References GenerateUniqueName(), GenerateUniqueOutputName(), InputSlot::GetConnectedOutputSlot(), Layer::GetInputSlot(), OutputSlot::GetOwningLayer(), GetTosaTensorShape(), GetUniqueTosaMappingID(), and ReshapeDescriptor::m_TargetShape.

+ +

Referenced by GetTosaMapping().

+ +
+
+
+
+
const InputSlot & GetInputSlot(unsigned int index) const override
Get a const input slot handle by slot index.
Definition: Layer.hpp:337
+ +
const std::string mainName
+
Layer & GetOwningLayer() const
Definition: Layer.hpp:132
+
DType ArmNNToDType(const DataType &type)
+
std::string GenerateUniqueOutputName(const Layer &layer, uint32_t layerSlot)
+
TensorShape m_TargetShape
Target shape value.
+
std::string GenerateUniqueName(const Layer &layer, uint32_t layerSlot)
+
std::vector< int32_t > GetTosaTensorShape(const TensorShape &shape)
+
const OutputSlot * GetConnectedOutputSlot() const
Definition: Layer.hpp:56
+
std::string GetUniqueTosaMappingID()
+ + + + -- cgit v1.2.1