ArmNN
 20.02
LogSoftmaxEndToEndTestImpl.cpp File Reference
#include "EndToEndTestImpl.hpp"
#include "LogSoftmaxEndToEndTestImpl.hpp"
#include <armnn/INetwork.hpp>
#include <test/TestUtils.hpp>
#include <boost/test/unit_test.hpp>

Go to the source code of this file.

Functions

void LogSoftmaxEndToEndTest (const std::vector< armnn::BackendId > &defaultBackends)
 

Function Documentation

◆ LogSoftmaxEndToEndTest()

void LogSoftmaxEndToEndTest ( const std::vector< armnn::BackendId > &  defaultBackends)

Definition at line 76 of file LogSoftmaxEndToEndTestImpl.cpp.

References armnn::Float32.

Referenced by BOOST_AUTO_TEST_CASE().

77 {
78  using namespace armnn;
79 
80  const float beta = 10.0f; // non-default beta
81  const int axis = 3; // positive axis
82 
83  const TensorShape inputShape{1, 1, 2, 4};
84  TensorInfo inputTensorInfo(inputShape, DataType::Float32);
85 
86  const TensorShape outputShape{1, 1, 2, 4};
87  TensorInfo outputTensorInfo(outputShape, DataType::Float32);
88 
89  std::vector<float> inputData = std::vector<float>({
90  0.0f, -0.6f, 0.2f, 0.4f,
91  0.3f, -0.2f, 1.0f, 0.1f
92  });
93 
94  std::vector<float> expectedOutputData = std::vector<float>({
95  -4.14297f, -10.14297f, -2.14297f, -0.14297f,
96  -7.00104f, -12.00104f, -0.00104087f, -9.00104f
97  });
98 
99  LogSoftmaxEndToEnd(defaultBackends,
100  inputTensorInfo,
101  outputTensorInfo,
102  inputData,
103  expectedOutputData,
104  beta,
105  axis);
106 }
Copyright (c) 2020 ARM Limited.
std::vector< armnn::BackendId > defaultBackends