From 8efb48a6847c5cd166c561127ae6611150963ce3 Mon Sep 17 00:00:00 2001 From: Nikhil Raj Date: Fri, 19 May 2023 11:14:28 +0100 Subject: Update Doxygen docu for 23.05 Signed-off-by: Nikhil Raj Change-Id: I0a992286f14fa68fcc6e5eba31ac39fed003cbbe --- 23.05/_constant_operator_8hpp.xhtml | 202 ++++++++++++++++++++++++++++++++++++ 1 file changed, 202 insertions(+) create mode 100644 23.05/_constant_operator_8hpp.xhtml (limited to '23.05/_constant_operator_8hpp.xhtml') diff --git a/23.05/_constant_operator_8hpp.xhtml b/23.05/_constant_operator_8hpp.xhtml new file mode 100644 index 0000000000..881bf49a91 --- /dev/null +++ b/23.05/_constant_operator_8hpp.xhtml @@ -0,0 +1,202 @@ + + + + + + + + + + + + + +ArmNN: src/backends/tosaCommon/operatorMappings/ConstantOperator.hpp File Reference + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  23.05 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
ConstantOperator.hpp File Reference
+
+
+
#include "TosaOperatorUtils.hpp"
+#include <Layer.hpp>
+#include <tosa_serialization_handler.h>
+
+

Go to the source code of this file.

+ + + + +

+Functions

TosaSerializationBasicBlock * ConvertConstantToTosaOperator (const Layer *layer, const std::vector< const TensorInfo * > &outputs)
 
+

Function Documentation

+ +

◆ ConvertConstantToTosaOperator()

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

Definition at line 10 of file ConstantOperator.cpp.

+
12 {
+
13  std::string outputName = std::string("constant_");
+
14  std::string blockName = std::string("Op_CONST_block_") + GetUniqueTosaMappingID();
+
15 
+
16  std::vector<uint8_t> uint8Data;
+
17 
+
18  // If a layer is present then the block will be used for execution, so names need to be unique.
+
19  // Also, set constant tensor data.
+
20  if(layer != nullptr)
+
21  {
+
22  outputName.append(std::to_string(layer->GetGuid()));
+
23  blockName.append(std::to_string(layer->GetGuid()));
+
24 
+
25  auto constantLayer = PolymorphicDowncast<const armnn::ConstantLayer*>(layer);
+
26  auto tensorInfo = constantLayer->GetOutputSlot().GetTensorInfo();
+
27 
+
28  uint8Data = ConvertConstantTensorDataToBuffer(constantLayer->m_LayerOutput);
+
29  }
+
30 
+
31  auto* op = new TosaSerializationOperator(Op_CONST, Attribute_NONE, nullptr, {}, {outputName});
+
32 
+
33  std::vector<int32_t> outputShape0 = GetTosaTensorShape(outputs[0]->GetShape());
+
34  DType outputDType0 = ArmNNToDType(outputs[0]->GetDataType());
+
35 
+
36  // Setup output tensor with constant tensor data if available.
+
37  auto* outputTensor0 = new TosaSerializationTensor(outputName, outputShape0, outputDType0, uint8Data);
+
38 
+
39  return new TosaSerializationBasicBlock(blockName, // name
+
40  {op}, // operators
+
41  {outputTensor0}, // tensors
+
42  {}, // inputs
+
43  {outputName}); // outputs
+
44 }
+
+

References ConvertConstantTensorDataToBuffer(), Layer::GetGuid(), GetTosaTensorShape(), and GetUniqueTosaMappingID().

+ +

Referenced by GetTosaMapping().

+ +
+
+
+
+
std::vector< int32_t > GetTosaTensorShape(const TensorShape &shape)
+
DType ArmNNToDType(const DataType &type)
+
LayerGuid GetGuid() const final
Returns the unique id of the layer.
Definition: Layer.hpp:330
+
std::vector< uint8_t > ConvertConstantTensorDataToBuffer(const std::shared_ptr< ConstTensorHandle > &tensorHandle)
+
std::string GetUniqueTosaMappingID()
+ + + + -- cgit v1.2.1