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/_elementwise_unary_operator_8cpp.html | 250 ++++++++++++++++++++++++++++ 1 file changed, 250 insertions(+) create mode 100644 23.11/_elementwise_unary_operator_8cpp.html (limited to '23.11/_elementwise_unary_operator_8cpp.html') diff --git a/23.11/_elementwise_unary_operator_8cpp.html b/23.11/_elementwise_unary_operator_8cpp.html new file mode 100644 index 0000000000..7571648bba --- /dev/null +++ b/23.11/_elementwise_unary_operator_8cpp.html @@ -0,0 +1,250 @@ + + + + + + + + +Arm NN: src/backends/tosaCommon/operatorMappings/ElementwiseUnaryOperator.cpp File Reference + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  23.11 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
ElementwiseUnaryOperator.cpp File Reference
+
+
+
+Include dependency graph for ElementwiseUnaryOperator.cpp:
+
+
+
+
+
+

Go to the source code of this file.

+ + + + +

+Functions

TosaSerializationBasicBlock * ConvertElementwiseUnaryOperator (const Layer *layer, const std::vector< const TensorInfo * > &inputs, const std::vector< const TensorInfo * > &outputs, const ElementwiseUnaryDescriptor *unaryDescriptor)
 
+

Function Documentation

+ +

◆ ConvertElementwiseUnaryOperator()

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

Definition at line 8 of file ElementwiseUnaryOperator.cpp.

+
12 {
+
13  std::string input0Name = std::string("input0_");
+
14  std::string outputName = std::string("output0_");
+
15  std::string blockName = std::string("Op_ELEMENTWISEUNARY_block_") + GetUniqueTosaMappingID();
+
16 
+
17 
+
18  // If a layer is present then the block will be used for execution, so input and output names need to be determined
+
19  // using the previous and following layers so the graph is connected correctly. For validation this doesn't matter.
+
20  if(layer != nullptr)
+
21  {
+
22  // Get the layer connected to the input slot and determine unique the tensor name.
+
23  Layer& connectedLayer0 = layer->GetInputSlot(0).GetConnectedOutputSlot()->GetOwningLayer();
+
24  input0Name = GenerateUniqueName(connectedLayer0, 0);
+
25 
+
26  // Determine unique output tensor name.
+
27  outputName = GenerateUniqueOutputName(*layer, 0);
+
28  }
+
29 
+
30  TosaSerializationOperator* op = nullptr;
+
31  switch(unaryDescriptor->m_Operation)
+
32  {
+
33  case UnaryOperation::Rsqrt:
+
34  {
+
35  op = new TosaSerializationOperator(tosa::Op_RSQRT,
+
36  Attribute_NONE,
+
37  nullptr,
+
38  {input0Name},
+
39  {outputName});
+
40  blockName = std::string("Op_RSQRT_block_") + GetUniqueTosaMappingID();
+
41  break;
+
42  }
+
43  default:
+
44  throw armnn::Exception("ConvertElementwiseUnaryToTosaOperator: Unsupported layer type.");
+
45  }
+
46 
+
47  ARMNN_ASSERT(op != nullptr);
+
48 
+
49  std::vector<TosaSerializationTensor*> tensors;
+
50  // Only add input tensor if connected layer is an input layer.
+
51  // As intermediate or constant tensors will be created separately.
+
52  // There also can't be duplicate tensor.
+
53  if(input0Name.find("input0_") != std::string::npos)
+
54  {
+
55  std::vector<int32_t> inputShape0 = GetTosaTensorShape(inputs[0]->GetShape());
+
56  DType inputDType0 = ArmNNToDType(inputs[0]->GetDataType());
+
57  tensors.push_back(new TosaSerializationTensor(input0Name, inputShape0, inputDType0, {}));
+
58  }
+
59 
+
60  std::vector<int32_t> outputShape0 = GetTosaTensorShape(outputs[0]->GetShape());
+
61  DType outputDType0 = ArmNNToDType(outputs[0]->GetDataType());
+
62 
+
63  tensors.push_back(new TosaSerializationTensor(outputName, outputShape0, outputDType0, {}));
+
64 
+
65  // operatorInputNames/operatorOutputNames ends up being the same as
+
66  // blockInputNames/blockOutputNames for one-to-one ArmNN to Tosa mappings
+
67  return new TosaSerializationBasicBlock(blockName, // name
+
68  mainName, // region name
+
69  {op}, // operators
+
70  tensors, // tensors
+
71  {input0Name}, // inputs
+
72  {outputName}); // outputs
+
73 }
+
+

References ARMNN_ASSERT, GenerateUniqueName(), GenerateUniqueOutputName(), InputSlot::GetConnectedOutputSlot(), Layer::GetInputSlot(), OutputSlot::GetOwningLayer(), GetTosaTensorShape(), GetUniqueTosaMappingID(), and ElementwiseUnaryDescriptor::m_Operation.

+ +

Referenced by GetTosaMapping().

+ +
+
+
+
+
#define ARMNN_ASSERT(COND)
Definition: Assert.hpp:14
+
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)
+
Base class for all ArmNN exceptions so that users can filter to just those.
Definition: Exceptions.hpp:46
+
UnaryOperation m_Operation
Specifies the elementwiseUnary operation to execute.
+
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