12{
13 std::string inputName = std::string("input_");
14 std::string outputName = std::string("output0_");
16
17
18
19 if(layer != nullptr)
20 {
23 }
24
25 std::vector<int32_t> begin(sliceDescriptor->
m_Begin.begin(), sliceDescriptor->
m_Begin.end());
26 std::vector<int32_t> size(sliceDescriptor->
m_Size.begin(), sliceDescriptor->
m_Size.end());
27
28 TosaSliceAttribute attribute(begin, size);
29
30 auto* op = new TosaSerializationOperator(Op_SLICE,
31 Attribute_SliceAttribute,
32 &attribute,
33 {inputName},
34 {outputName});
35
36 std::vector<TosaSerializationTensor*> tensors;
37
38
39
40
41 if(inputName.find("input_") != std::string::npos)
42 {
44 DType inputDType =
ArmNNToDType(inputs[0]->GetDataType());
45
46 tensors.push_back(new TosaSerializationTensor(inputName, inputShape, inputDType, {}));
47 }
48
50 DType outputDType =
ArmNNToDType(outputs[0]->GetDataType());
51
52 tensors.push_back(new TosaSerializationTensor(outputName, outputShape, outputDType, {}));
53
54
55
56 return new TosaSerializationBasicBlock(blockName,
58 {op},
59 tensors,
60 {inputName},
61 {outputName});
62}
std::string GenerateUniqueOutputName(const Layer &layer, uint32_t layerSlot=0)
const std::string mainName
DType ArmNNToDType(const DataType &type)
std::string GenerateUniqueInputName(const armnn::InputSlot &slot)
std::string GetUniqueTosaMappingID()
std::vector< int32_t > GetTosaTensorShape(const TensorShape &shape)
const InputSlot & GetInputSlot(unsigned int index) const override
Get a const input slot handle by slot index.
std::vector< unsigned int > m_Begin
Beginning indices of the slice in each dimension.
std::vector< unsigned int > m_Size
Size of the slice in each dimension.