aboutsummaryrefslogtreecommitdiff
path: root/src/backends/tosaCommon/test/TosaTestUtils.hpp
diff options
context:
space:
mode:
authorMatthew Sloyan <matthew.sloyan@arm.com>2022-12-08 13:38:23 +0000
committerCathal Corbett <cathal.corbett@arm.com>2022-12-15 10:00:12 +0000
commitfc9d5e7d1e0c1a4d7fed4ebc363832e03c3e2543 (patch)
tree5c1b7efd146256c2de9781ae5a60e22cf2d6142a /src/backends/tosaCommon/test/TosaTestUtils.hpp
parent67fd526f8f7c79803d514a6045454049104eced9 (diff)
downloadarmnn-fc9d5e7d1e0c1a4d7fed4ebc363832e03c3e2543.tar.gz
IVGCVSW-7204 Add TransposeConv2d support to TOSA Reference Backend
Signed-off-by: Matthew Sloyan <matthew.sloyan@arm.com> Change-Id: I9bfd597afd41468f304edfbe5d7141378ce60d4f
Diffstat (limited to 'src/backends/tosaCommon/test/TosaTestUtils.hpp')
-rw-r--r--src/backends/tosaCommon/test/TosaTestUtils.hpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/backends/tosaCommon/test/TosaTestUtils.hpp b/src/backends/tosaCommon/test/TosaTestUtils.hpp
index 93b9e7d36f..140cb83983 100644
--- a/src/backends/tosaCommon/test/TosaTestUtils.hpp
+++ b/src/backends/tosaCommon/test/TosaTestUtils.hpp
@@ -144,6 +144,20 @@ inline void VerifyTosaAttribute(const BaseDescriptor& descriptor,
break;
}
+ case LayerType::TransposeConvolution2d:
+ {
+ auto transposeConv2dDesc = PolymorphicDowncast<const TransposeConvolution2dDescriptor*>(&descriptor);
+ std::vector<int> outPad = {-static_cast<int>(transposeConv2dDesc->m_PadTop),
+ -static_cast<int>(transposeConv2dDesc->m_PadBottom),
+ -static_cast<int>(transposeConv2dDesc->m_PadLeft),
+ -static_cast<int>(transposeConv2dDesc->m_PadRight)};
+ std::vector<int> stride = {static_cast<int>(transposeConv2dDesc->m_StrideY),
+ static_cast<int>(transposeConv2dDesc->m_StrideX)};
+ TosaTransposeConvAttribute transposeConvAttribute(attribute);
+ CHECK(outPad == transposeConvAttribute.out_pad());
+ CHECK(stride == transposeConvAttribute.stride());
+ break;
+ }
default:
break;
}
@@ -167,12 +181,7 @@ inline void AssertTosaOneToOneMappingBasicBlock(TosaSerializationBasicBlock* bas
// The number of tensors in the block can be different if there are constant layers, as they are created separately.
if(type == LayerType::Convolution2d)
{
- numInputTensors = 2;
- auto conv2dDesc = PolymorphicDowncast<const Convolution2dDescriptor*>(&descriptor);
- if(conv2dDesc->m_BiasEnabled)
- {
- numInputTensors = 3;
- }
+ numInputTensors = PolymorphicDowncast<const Convolution2dDescriptor*>(&descriptor)->m_BiasEnabled ? 3 : 2;
}
std::string blockStr = operatorString + "_block_";