// // Copyright © 2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // #include "BroadcastToTestHelper.hpp" #include #include #include #include #include #include #include namespace armnnDelegate { template void BroadcastToTest(std::vector &backends, tflite::TensorType inputTensorType) { // Set input data std::vector inputValues = { 0, 1, 2, 3 }; // Set output data std::vector expectedOutputValues = { 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3 }; // The shape data const std::vector shapeData = {3, 4}; // Set shapes const std::vector inputShape = {1, 4}; const std::vector shapeShape = {2}; const std::vector expectedOutputShape = {3, 4}; BroadcastToTestImpl(inputTensorType, tflite::BuiltinOperator_BROADCAST_TO, inputValues, inputShape, shapeShape, shapeData, expectedOutputValues, expectedOutputShape, backends); } TEST_SUITE("BroadcastToTests_Tests") { /** * Only CpuRef is supported for these tests. */ TEST_CASE ("BroadcastTo_int_Test") { std::vector backends = {armnn::Compute::CpuRef}; BroadcastToTest(backends, ::tflite::TensorType::TensorType_INT32); } TEST_CASE ("BroadcastTo_Float32_Test") { std::vector backends = {armnn::Compute::CpuRef}; BroadcastToTest(backends, ::tflite::TensorType::TensorType_FLOAT32); } TEST_CASE ("BroadcastTo_Uint8_t_Test") { std::vector backends = {armnn::Compute::CpuRef}; BroadcastToTest(backends, ::tflite::TensorType::TensorType_UINT8); } TEST_CASE ("BroadcastTo_Int8_t_Test") { std::vector backends = {armnn::Compute::CpuRef}; BroadcastToTest(backends, ::tflite::TensorType::TensorType_INT8); } } // TEST_SUITE("BroadcastToTests_CpuRefTests") }