9 const std::vector<const TensorInfo*>& inputs,
10 const std::vector<const TensorInfo*>& outputs,
13 std::string inputName = std::string(
"input_");
14 std::string outputName = std::string(
"output0_");
27 auto* op =
new TosaSerializationOperator(Op_RESHAPE,
28 Attribute_ReshapeAttribute,
33 std::vector<TosaSerializationTensor*> tensors;
36 DType outputDType =
ArmNNToDType(outputs[0]->GetDataType());
41 if(inputName.find(
"input_") != std::string::npos)
46 if (inputShape.size() < outputShape.size())
48 for (
size_t i = inputShape.size(); i < outputShape.size(); ++i)
50 inputShape.emplace_back(1);
54 DType inputDType =
ArmNNToDType(inputs[0]->GetDataType());
56 tensors.push_back(
new TosaSerializationTensor(inputName, inputShape, inputDType, {}));
59 tensors.push_back(
new TosaSerializationTensor(outputName, outputShape, outputDType, {}));
63 return new TosaSerializationBasicBlock(blockName,
TosaSerializationBasicBlock * ConvertReshapeToTosaOperator(const Layer *layer, const std::vector< const TensorInfo * > &inputs, const std::vector< const TensorInfo * > &outputs, const ReshapeDescriptor *reshapeDescriptor)
std::string GenerateUniqueOutputName(const Layer &layer, uint32_t layerSlot=0)
const std::string mainName
DType ArmNNToDType(const DataType &type)
std::vector< int32_t > GetTosaTensorShape(const TensorShape &shape)
std::string GenerateUniqueInputName(const armnn::InputSlot &slot)
std::string GetUniqueTosaMappingID()
const InputSlot & GetInputSlot(unsigned int index) const override
Get a const input slot handle by slot index.
A ReshapeDescriptor for the ReshapeLayer.
TensorShape m_TargetShape
Target shape value.