15 explicit ElementwiseUnaryFixture(
const std::string& inputShape,
16 const std::string& outputShape,
17 const std::string& dataType,
18 const std::string& unaryOperation =
"Abs")
26 layer_type: "InputLayer", 32 layerName: "InputLayer", 36 connection: {sourceLayerIndex:0, outputSlotIndex:0 }, 41 dimensions: )" + inputShape + R"(, 42 dataType: )" + dataType + R"( 50 layer_type: "ElementwiseUnaryLayer", 54 layerName: "ElementwiseUnaryLayer", 55 layerType: "ElementwiseUnary", 58 connection: {sourceLayerIndex:0, outputSlotIndex:0 }, 63 dimensions: )" + outputShape + R"(, 64 dataType: )" + dataType + R"( 69 activationFunction: )" + unaryOperation + R"( 74 layer_type: "OutputLayer", 80 layerName: "OutputLayer", 84 connection: {sourceLayerIndex:1, outputSlotIndex:0 }, 89 dimensions: )" + outputShape + R"(, 90 dataType: )" + dataType + R"( 104 struct SimpleAbsFixture : ElementwiseUnaryFixture
106 SimpleAbsFixture() : ElementwiseUnaryFixture(
"[ 1, 2, 2, 2 ]",
113 FIXTURE_TEST_CASE(SimpleAbsTest, SimpleAbsFixture)
115 RunTest<4, armnn::DataType::Float32>(
117 {{
"InputLayer", {-100.0f, -50.5f, -25.9999f, -0.5f, 0.0f, 1.5555f, 25.5f, 100.0f}}},
118 {{
"OutputLayer", {100.0f, 50.5f, 25.9999f, 0.5f, 0.0f, 1.5555f, 25.5f, 100.0f}}});
121 struct SimpleLogFixture : ElementwiseUnaryFixture
123 SimpleLogFixture() : ElementwiseUnaryFixture(
"[ 1, 2, 2, 2 ]",
130 FIXTURE_TEST_CASE(SimpleLogTest, SimpleLogFixture)
132 RunTest<4, armnn::DataType::Float32>(
134 {{
"InputLayer", {1.0f, 2.1f, 3.2f, 4.3f, 10.f, 100.f, 25.5f, 200.0f}}},
135 {{
"OutputLayer", {0.f, 0.74193734472f, 1.16315080981f, 1.4586150227f,
136 2.30258509299f, 4.60517018599f, 3.23867845216f, 5.29831736655f}}});
139 struct SimpleNegFixture : ElementwiseUnaryFixture
141 SimpleNegFixture() : ElementwiseUnaryFixture(
"[ 1, 2, 2, 2 ]",
148 FIXTURE_TEST_CASE(SimpleNegTest, SimpleNegFixture)
150 RunTest<4, armnn::DataType::Float32>(
152 {{
"InputLayer", {100.0f, 50.5f, 25.9999f, 0.5f, 0.0f, -1.5555f, -25.5f, -100.0f}}},
153 {{
"OutputLayer", {-100.0f, -50.5f, -25.9999f, -0.5f, 0.0f, 1.5555f, 25.5f, 100.0f}}});
156 struct SimpleSinFixture : ElementwiseUnaryFixture
158 SimpleSinFixture() : ElementwiseUnaryFixture(
"[ 1, 2, 2, 2 ]",
165 FIXTURE_TEST_CASE(SimpleSinTest, SimpleSinFixture)
167 RunTest<4, armnn::DataType::Float32>(
169 {{
"InputLayer", {-100.0f, -50.5f, -25.9999f, -0.5f, 0.0f, 1.5555f, 25.5f, 100.0f}}},
170 {{
"OutputLayer", {0.50636564111f, -0.23237376165f, -0.76249375473f, -0.4794255386f,
171 0.0f, 0.99988301347f, 0.35905835402f, -0.50636564111f}}});