From d7fca093be53b314e100e15a8fa080cb506b60a3 Mon Sep 17 00:00:00 2001 From: David Monahan Date: Thu, 12 Jan 2023 14:53:34 +0000 Subject: IVGCVSW-7173 Add Rsqrt to Tosa Ref Backend * Added ElementwiseUnary support with a mapping for Rsqrt * Added unittests * Added Rsqrt EndtoEnd tests for all backends * Changed TosaRefLayerSupport to default to false on unsupported layers Signed-off-by: David Monahan Change-Id: I3eaa9c684647ead61520a563815581aa68bee51b --- .../test/ElementwiseUnaryEndToEndTestImpl.hpp | 31 ++++++++-- src/backends/cl/test/ClEndToEndTests.cpp | 16 ++--- src/backends/neon/test/NeonEndToEndTests.cpp | 16 ++--- src/backends/reference/test/RefEndToEndTests.cpp | 47 +++++++------- src/backends/tosaCommon/TosaMappings.cpp | 7 ++- .../tosaCommon/operatorMappings/CMakeLists.txt | 4 +- .../operatorMappings/ElementwiseUnaryOperator.cpp | 72 ++++++++++++++++++++++ .../operatorMappings/ElementwiseUnaryOperator.hpp | 19 ++++++ .../operatorMappings/TosaCommonOperators.hpp | 3 +- .../tosaCommon/test/OneToOneMappingTests.cpp | 52 +++++++++++++++- src/backends/tosaReference/TosaRefLayerSupport.cpp | 6 +- .../tosaReference/test/TosaRefEndToEndTests.cpp | 9 ++- .../test/TosaRefLayerSupportTests.cpp | 42 ++++++++++++- 13 files changed, 270 insertions(+), 54 deletions(-) create mode 100644 src/backends/tosaCommon/operatorMappings/ElementwiseUnaryOperator.cpp create mode 100644 src/backends/tosaCommon/operatorMappings/ElementwiseUnaryOperator.hpp diff --git a/src/backends/backendsCommon/test/ElementwiseUnaryEndToEndTestImpl.hpp b/src/backends/backendsCommon/test/ElementwiseUnaryEndToEndTestImpl.hpp index 3f530ccb15..9586417407 100644 --- a/src/backends/backendsCommon/test/ElementwiseUnaryEndToEndTestImpl.hpp +++ b/src/backends/backendsCommon/test/ElementwiseUnaryEndToEndTestImpl.hpp @@ -1,5 +1,5 @@ // -// Copyright © 2019 Arm Ltd. All rights reserved. +// Copyright © 2020-2021, 2023 Arm Ltd. All rights reserved. // SPDX-License-Identifier: MIT // #pragma once @@ -47,8 +47,7 @@ INetworkPtr CreateElementwiseUnaryNetwork(const TensorShape& inputShape, template> void ElementwiseUnarySimpleEndToEnd(const std::vector& backends, - UnaryOperation operation, - const std::vector expectedOutput) + UnaryOperation operation) { using namespace armnn; @@ -63,8 +62,30 @@ void ElementwiseUnarySimpleEndToEnd(const std::vector& backends, CHECK(net); - const std::vector input({ 1, -1, 1, 1, 5, -5, 5, 5, - -3, 3, 3, 3, 4, 4, -4, 4 }); + std::vector input; + std::vector expectedOutput; + switch(operation) + { + case UnaryOperation::Abs: + input = { 1, -1, 1, 1, 5, -5, 5, 5, + -3, 3, 3, 3, 4, 4, -4, 4 }; + expectedOutput = { 1.f, 1.f, 1.f, 1.f, 5.f, 5.f, 5.f, 5.f, + 3.f, 3.f, 3.f, 3.f, 4.f, 4.f, 4.f, 4.f }; + break; + case UnaryOperation::Rsqrt: + input = { 1, 1, 1, 1, 5, 5, 5, 5, + 3, 3, 3, 3, 4, 4, 4, 4 }; + expectedOutput = { 1.f, 1.f, 1.f, 1.f, 0.447214f, 0.447214f, 0.447214f, 0.447214f, + 0.57735f, 0.57735f, 0.57735f, 0.57735f, 0.5f, 0.5f, 0.5f, 0.5f }; + break; + default: + input = { 1, -1, 1, 1, 5, -5, 5, 5, + -3, 3, 3, 3, 4, 4, -4, 4 }; + expectedOutput = { 1.f, 1.f, 1.f, 1.f, 5.f, 5.f, 5.f, 5.f, + 3.f, 3.f, 3.f, 3.f, 4.f, 4.f, 4.f, 4.f }; + break; + } + // quantize data std::vector qInputData = armnnUtils::QuantizedVector(input, qScale, qOffset); diff --git a/src/backends/cl/test/ClEndToEndTests.cpp b/src/backends/cl/test/ClEndToEndTests.cpp index d5ac8b11bc..4ff2b79d08 100644 --- a/src/backends/cl/test/ClEndToEndTests.cpp +++ b/src/backends/cl/test/ClEndToEndTests.cpp @@ -31,18 +31,18 @@ TEST_SUITE("ClEndToEnd") { std::vector clDefaultBackends = {armnn::Compute::GpuAcc}; +// ElementwiseUnary // Abs TEST_CASE("ClAbsEndToEndTestFloat32") { - std::vector expectedOutput = - { - 1.f, 1.f, 1.f, 1.f, 5.f, 5.f, 5.f, 5.f, - 3.f, 3.f, 3.f, 3.f, 4.f, 4.f, 4.f, 4.f - }; - ElementwiseUnarySimpleEndToEnd(clDefaultBackends, - UnaryOperation::Abs, - expectedOutput); + UnaryOperation::Abs); +} +// Rsqrt +TEST_CASE("ClRsqrtEndToEndTestFloat32") +{ + ElementwiseUnarySimpleEndToEnd(clDefaultBackends, + UnaryOperation::Rsqrt); } // Addition diff --git a/src/backends/neon/test/NeonEndToEndTests.cpp b/src/backends/neon/test/NeonEndToEndTests.cpp index d74c50109a..b930004215 100644 --- a/src/backends/neon/test/NeonEndToEndTests.cpp +++ b/src/backends/neon/test/NeonEndToEndTests.cpp @@ -33,18 +33,18 @@ TEST_SUITE("NeonEndToEnd") { std::vector neonDefaultBackends = {armnn::Compute::CpuAcc}; +// ElementwiseUnary // Abs TEST_CASE("NeonAbsEndToEndTestFloat32") { - std::vector expectedOutput = - { - 1.f, 1.f, 1.f, 1.f, 5.f, 5.f, 5.f, 5.f, - 3.f, 3.f, 3.f, 3.f, 4.f, 4.f, 4.f, 4.f - }; - ElementwiseUnarySimpleEndToEnd(neonDefaultBackends, - UnaryOperation::Abs, - expectedOutput); + UnaryOperation::Abs); +} +// Rsqrt +TEST_CASE("NeonRsqrtEndToEndTestFloat32") +{ + ElementwiseUnarySimpleEndToEnd(neonDefaultBackends, + UnaryOperation::Rsqrt); } // Constant diff --git a/src/backends/reference/test/RefEndToEndTests.cpp b/src/backends/reference/test/RefEndToEndTests.cpp index 8fcb3d19bc..6ff57716d0 100644 --- a/src/backends/reference/test/RefEndToEndTests.cpp +++ b/src/backends/reference/test/RefEndToEndTests.cpp @@ -43,46 +43,43 @@ TEST_SUITE("RefEndToEnd") { std::vector defaultBackends = {armnn::Compute::CpuRef}; +// ElementwiseUnary // Abs TEST_CASE("RefAbsEndToEndTestFloat32") { - std::vector expectedOutput = - { - 1.f, 1.f, 1.f, 1.f, 5.f, 5.f, 5.f, 5.f, - 3.f, 3.f, 3.f, 3.f, 4.f, 4.f, 4.f, 4.f - }; - ElementwiseUnarySimpleEndToEnd(defaultBackends, - UnaryOperation::Abs, - expectedOutput); + UnaryOperation::Abs); } TEST_CASE("RefAbsEndToEndTestUint8") { - // Note the expected output will be implicitly quantized by the below test function - std::vector expectedOutput = - { - 1.f, 1.f, 1.f, 1.f, 5.f, 5.f, 5.f, 5.f, - 3.f, 3.f, 3.f, 3.f, 4.f, 4.f, 4.f, 4.f - }; - ElementwiseUnarySimpleEndToEnd(defaultBackends, - UnaryOperation::Abs, - expectedOutput); + UnaryOperation::Abs); } TEST_CASE("RefAbsEndToEndTestInt16") { - // Note the expected output will be implicitly quantized by the below test function - std::vector expectedOutput = - { - 1.f, 1.f, 1.f, 1.f, 5.f, 5.f, 5.f, 5.f, - 3.f, 3.f, 3.f, 3.f, 4.f, 4.f, 4.f, 4.f - }; + ElementwiseUnarySimpleEndToEnd(defaultBackends, + UnaryOperation::Abs); +} +// Rsqrt +TEST_CASE("RefRsqrtEndToEndTestFloat32") +{ + ElementwiseUnarySimpleEndToEnd(defaultBackends, + UnaryOperation::Rsqrt); +} + +TEST_CASE("RefRsqrtEndToEndTestUint8") +{ + ElementwiseUnarySimpleEndToEnd(defaultBackends, + UnaryOperation::Rsqrt); +} + +TEST_CASE("RefRsqrtEndToEndTestInt16") +{ ElementwiseUnarySimpleEndToEnd(defaultBackends, - UnaryOperation::Abs, - expectedOutput); + UnaryOperation::Rsqrt); } // Addition diff --git a/src/backends/tosaCommon/TosaMappings.cpp b/src/backends/tosaCommon/TosaMappings.cpp index 0b5fa1a158..3932b62b7b 100644 --- a/src/backends/tosaCommon/TosaMappings.cpp +++ b/src/backends/tosaCommon/TosaMappings.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2022 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2022-2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -29,6 +29,11 @@ TosaSerializationBasicBlock* GetTosaMapping(const Layer* layer, { return ConvertElementwiseBinaryToTosaOperator(layer, type, inputs, outputs); } + case LayerType::ElementwiseUnary: + { + auto unaryDesc = PolymorphicDowncast(&descriptor); + return ConvertElementwiseUnaryOperator(layer, inputs, outputs, unaryDesc); + } case LayerType::Concat: { auto concatDesc = PolymorphicDowncast(&descriptor); diff --git a/src/backends/tosaCommon/operatorMappings/CMakeLists.txt b/src/backends/tosaCommon/operatorMappings/CMakeLists.txt index 2ec052cd43..26f51b643f 100644 --- a/src/backends/tosaCommon/operatorMappings/CMakeLists.txt +++ b/src/backends/tosaCommon/operatorMappings/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright © 2022 Arm Ltd and Contributors. All rights reserved. +# Copyright © 2022-2023 Arm Ltd and Contributors. All rights reserved. # SPDX-License-Identifier: MIT # @@ -14,6 +14,8 @@ list(APPEND armnnTosaBackendOperators_sources Conv2dOperator.cpp ElementwiseBinaryOperator.hpp ElementwiseBinaryOperator.cpp + ElementwiseUnaryOperator.cpp + ElementwiseUnaryOperator.hpp Pooling2DOperator.hpp Pooling2DOperator.cpp ReshapeOperator.hpp diff --git a/src/backends/tosaCommon/operatorMappings/ElementwiseUnaryOperator.cpp b/src/backends/tosaCommon/operatorMappings/ElementwiseUnaryOperator.cpp new file mode 100644 index 0000000000..15fb9d746b --- /dev/null +++ b/src/backends/tosaCommon/operatorMappings/ElementwiseUnaryOperator.cpp @@ -0,0 +1,72 @@ +// +// Copyright © 2023 Arm Ltd and Contributors. All rights reserved. +// SPDX-License-Identifier: MIT +// + +#include "ElementwiseUnaryOperator.hpp" + +TosaSerializationBasicBlock* ConvertElementwiseUnaryOperator(const Layer* layer, + const std::vector& inputs, + const std::vector& outputs, + const ElementwiseUnaryDescriptor* unaryDescriptor) +{ + std::string input0Name = std::string("input0_"); + std::string outputName = std::string("output0_"); + std::string blockName = std::string("Op_ELEMENTWISEUNARY_block_") + GetUniqueTosaMappingID(); + + + // If a layer is present then the block will be used for execution, so input and output names need to be determined + // using the previous and following layers so the graph is connected correctly. For validation this doesn't matter. + if(layer != nullptr) + { + // Get the layer connected to the input slot and determine unique the tensor name. + Layer& connectedLayer0 = layer->GetInputSlot(0).GetConnectedOutputSlot()->GetOwningLayer(); + input0Name = GenerateUniqueName(connectedLayer0, 0); + + // Determine unique output tensor name. + outputName = GenerateUniqueOutputName(*layer, 0); + } + + TosaSerializationOperator* op = nullptr; + switch(unaryDescriptor->m_Operation) + { + case UnaryOperation::Rsqrt: + { + op = new TosaSerializationOperator(tosa::Op_RSQRT, + Attribute_NONE, + nullptr, + {input0Name}, + {outputName}); + blockName = std::string("Op_RSQRT_block_") + GetUniqueTosaMappingID(); + break; + } + default: + throw armnn::Exception("ConvertElementwiseUnaryToTosaOperator: Unsupported layer type."); + } + + ARMNN_ASSERT(op != nullptr); + + std::vector tensors; + // Only add input tensor if connected layer is an input layer. + // As intermediate or constant tensors will be created separately. + // There also can't be duplicate tensor. + if(input0Name.find("input0_") != std::string::npos) + { + std::vector inputShape0 = GetTosaTensorShape(inputs[0]->GetShape()); + DType inputDType0 = ArmNNToDType(inputs[0]->GetDataType()); + tensors.push_back(new TosaSerializationTensor(input0Name, inputShape0, inputDType0, {})); + } + + std::vector outputShape0 = GetTosaTensorShape(outputs[0]->GetShape()); + DType outputDType0 = ArmNNToDType(outputs[0]->GetDataType()); + + tensors.push_back(new TosaSerializationTensor(outputName, outputShape0, outputDType0, {})); + + // operatorInputNames/operatorOutputNames ends up being the same as + // blockInputNames/blockOutputNames for one-to-one ArmNN to Tosa mappings + return new TosaSerializationBasicBlock(blockName, // name + {op}, // operators + tensors, // tensors + {input0Name}, // inputs + {outputName}); // outputs +} \ No newline at end of file diff --git a/src/backends/tosaCommon/operatorMappings/ElementwiseUnaryOperator.hpp b/src/backends/tosaCommon/operatorMappings/ElementwiseUnaryOperator.hpp new file mode 100644 index 0000000000..d13428ca5a --- /dev/null +++ b/src/backends/tosaCommon/operatorMappings/ElementwiseUnaryOperator.hpp @@ -0,0 +1,19 @@ +// +// Copyright © 2023 Arm Ltd and Contributors. All rights reserved. +// SPDX-License-Identifier: MIT +// + +#pragma once + +#include "TosaOperatorUtils.hpp" +#include + +#include + +using namespace armnn; +using namespace tosa; + +TosaSerializationBasicBlock* ConvertElementwiseUnaryOperator(const Layer* layer, + const std::vector& inputs, + const std::vector& outputs, + const ElementwiseUnaryDescriptor* unaryDescriptor); diff --git a/src/backends/tosaCommon/operatorMappings/TosaCommonOperators.hpp b/src/backends/tosaCommon/operatorMappings/TosaCommonOperators.hpp index 3f27371295..66dc1b342a 100644 --- a/src/backends/tosaCommon/operatorMappings/TosaCommonOperators.hpp +++ b/src/backends/tosaCommon/operatorMappings/TosaCommonOperators.hpp @@ -1,5 +1,5 @@ // -// Copyright © 2022 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2022-2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -10,6 +10,7 @@ #include "ConstantOperator.hpp" #include "Conv2dOperator.hpp" #include "ElementwiseBinaryOperator.hpp" +#include "ElementwiseUnaryOperator.hpp" #include "Pooling2DOperator.hpp" #include "ReshapeOperator.hpp" #include "SliceOperator.hpp" diff --git a/src/backends/tosaCommon/test/OneToOneMappingTests.cpp b/src/backends/tosaCommon/test/OneToOneMappingTests.cpp index 4cc37918e5..6e532abcf7 100644 --- a/src/backends/tosaCommon/test/OneToOneMappingTests.cpp +++ b/src/backends/tosaCommon/test/OneToOneMappingTests.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2022 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2022-2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -252,6 +252,56 @@ TEST_CASE("GetTosaMappingFromLayer_Conv2dLayer") AssertTosaOneToOneMappingBasicBlock( basicBlock, inputShape, outputShape, Op_CONV2D, Attribute_ConvAttribute, descriptor, LayerType::Convolution2d); } +TEST_CASE("GetTosaMapping_ElementwiseUnaryLayerRsqrt") +{ + TensorInfo inputInfo = TensorInfo({ 2, 2 }, DataType::Float32, 0.0f, 0, true); + TensorInfo outputInfo = TensorInfo({ 2, 2 }, DataType::Float32, 0.0f, 0, true); + std::vector> inputShape = {{ 2, 2 }}; + std::vector> outputShape = {{ 2, 2 }}; + + ElementwiseUnaryDescriptor unaryDescriptor = ElementwiseUnaryDescriptor(UnaryOperation::Rsqrt); + TosaSerializationBasicBlock* basicBlock = + GetTosaMapping(nullptr, LayerType::ElementwiseUnary, {&inputInfo,}, {&outputInfo}, unaryDescriptor); + + AssertTosaOneToOneMappingBasicBlock(basicBlock, + inputShape, + outputShape, + tosa::Op_RSQRT, + tosa::Attribute_NONE, + unaryDescriptor, + LayerType::ElementwiseUnary); +} +TEST_CASE("GetTosaMappingFromLayer_ElementwiseUnaryLayerRsqrt") +{ + IRuntime::CreationOptions options; + IRuntimePtr runtime(IRuntime::Create(options)); + + // Builds up the structure of the network. + INetworkPtr net(INetwork::Create()); + ElementwiseUnaryDescriptor unaryDescriptor = ElementwiseUnaryDescriptor(UnaryOperation::Rsqrt); + IConnectableLayer* input = net->AddInputLayer(0, "input0"); + IConnectableLayer* unaryRsqrt = net->AddElementwiseUnaryLayer(unaryDescriptor, "rsqrt"); + IConnectableLayer* output = net->AddOutputLayer(0, "output"); + + input->GetOutputSlot(0).Connect(unaryRsqrt->GetInputSlot(0)); + unaryRsqrt->GetOutputSlot(0).Connect(output->GetInputSlot(0)); + TensorInfo inputInfo = TensorInfo({ 2, 2 }, DataType::Float32, 0.0f, 0, true); + TensorInfo outputInfo = TensorInfo({ 2, 2 }, DataType::Float32, 0.0f, 0, true); + input->GetOutputSlot(0).SetTensorInfo(inputInfo); + unaryRsqrt->GetOutputSlot(0).SetTensorInfo(outputInfo); + std::vector> inputShape = {{ 2, 2 }}; + std::vector> outputShape = {{ 2, 2 }}; + + TosaSerializationBasicBlock* basicBlock = + GetTosaMappingFromLayer(PolymorphicDowncast(unaryRsqrt)); + AssertTosaOneToOneMappingBasicBlock(basicBlock, + inputShape, + outputShape, + tosa::Op_RSQRT, + tosa::Attribute_NONE, + unaryDescriptor, + LayerType::ElementwiseUnary); +} TEST_CASE("GetTosaMapping_MultiplicationLayer") { diff --git a/src/backends/tosaReference/TosaRefLayerSupport.cpp b/src/backends/tosaReference/TosaRefLayerSupport.cpp index 6113b5861a..238801cb98 100644 --- a/src/backends/tosaReference/TosaRefLayerSupport.cpp +++ b/src/backends/tosaReference/TosaRefLayerSupport.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2022 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2022-2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -68,6 +68,7 @@ bool TosaRefLayerSupport::IsLayerSupported(const LayerType& type, } break; } + case LayerType::ElementwiseUnary: case LayerType::Pooling2d: case LayerType::Reshape: case LayerType::Slice: @@ -89,7 +90,8 @@ bool TosaRefLayerSupport::IsLayerSupported(const LayerType& type, break; } default: - break; + // Default to false for all unsupported layers. + return false; } auto mappings = GetTosaMapping(nullptr, type, inputInfos, outputInfos, descriptor); diff --git a/src/backends/tosaReference/test/TosaRefEndToEndTests.cpp b/src/backends/tosaReference/test/TosaRefEndToEndTests.cpp index e19462e986..26cadd22db 100644 --- a/src/backends/tosaReference/test/TosaRefEndToEndTests.cpp +++ b/src/backends/tosaReference/test/TosaRefEndToEndTests.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2022 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2022-2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -11,6 +11,7 @@ #include "backendsCommon/test/MultiplicationEndToEndTestImpl.hpp" #include "backendsCommon/test/Pooling2dEndToEndTestImpl.hpp" #include "backendsCommon/test/ReshapeEndToEndTestImpl.hpp" +#include "backendsCommon/test/ElementwiseUnaryEndToEndTestImpl.hpp" #include "backendsCommon/test/SliceEndToEndTestImpl.hpp" #include "backendsCommon/test/SubtractionEndToEndTestImpl.hpp" #include "backendsCommon/test/TransposeConvolution2dEndToEndTestImpl.hpp" @@ -138,6 +139,12 @@ TEST_CASE("TosaRefReshapeEndtoEndTestFloat16") ReshapeEndToEndFloat16(tosaDefaultBackends); } +TEST_CASE("TosaRefRsqrtEndtoEndTestFloat32") +{ + ElementwiseUnarySimpleEndToEnd(tosaDefaultBackends, + UnaryOperation::Rsqrt); +} + // Slice TEST_CASE("TosaRefSliceEndtoEndTestFloat32") { diff --git a/src/backends/tosaReference/test/TosaRefLayerSupportTests.cpp b/src/backends/tosaReference/test/TosaRefLayerSupportTests.cpp index 66dfbe8dff..e32894f0b6 100644 --- a/src/backends/tosaReference/test/TosaRefLayerSupportTests.cpp +++ b/src/backends/tosaReference/test/TosaRefLayerSupportTests.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2022 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2022-2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -374,6 +374,46 @@ TEST_CASE("IsLayerSupportedTosaReferenceReshapeUnsupported") CHECK(!supported); } +TEST_CASE("IsLayerSupportedTosaReferenceRsqrt") +{ + TensorShape shape0 = {2,2}; + TensorShape outShape = {2,2}; + TensorInfo in0(shape0, DataType::Float32); + TensorInfo out(outShape, DataType::Float32); + + ElementwiseUnaryDescriptor desc(UnaryOperation::Rsqrt); + TosaRefLayerSupport supportChecker; + std::string reasonIfNotSupported; + auto supported = supportChecker.IsLayerSupported(LayerType::ElementwiseUnary, + {in0, out}, + desc, + EmptyOptional(), + EmptyOptional(), + reasonIfNotSupported); + + CHECK(supported); +} + +TEST_CASE("IsLayerSupportedTosaReferenceRsqrtUnsupported") +{ + TensorShape shape0 = {1,1,3,4}; + TensorShape outShape = {1,3,1,4}; + TensorInfo in0(shape0, DataType::Signed64); + TensorInfo out(outShape, DataType::Signed64); + + ElementwiseUnaryDescriptor desc(UnaryOperation::Rsqrt); + TosaRefLayerSupport supportChecker; + std::string reasonIfNotSupported; + auto supported = supportChecker.IsLayerSupported(LayerType::ElementwiseUnary, + {in0, out}, + desc, + EmptyOptional(), + EmptyOptional(), + reasonIfNotSupported); + + CHECK(!supported); +} + TEST_CASE("IsLayerSupportedTosaReferenceSlice") { TensorShape inShape = {3,2,3}; -- cgit v1.2.1