6 #include <boost/test/unit_test.hpp> 14 explicit ActivationFixture(
const char* activationFunction)
17 " name: \"Placeholder\"\n" 18 " op: \"Placeholder\"\n" 29 " unknown_rank: true\n" 41 " input: \"Placeholder\"\n" 55 struct ReLuFixture : ActivationFixture
57 ReLuFixture() : ActivationFixture(
"Relu") {}
61 RunTest<2>({ -1.0f, -0.5f, 1.25f, -3.0f, 0.0f, 0.5f, -0.75f },
62 { 0.0f, 0.0f, 1.25f, 0.0f, 0.0f, 0.5f, 0.0f });
66 struct ReLu6Fixture : ActivationFixture
68 ReLu6Fixture() : ActivationFixture(
"Relu6") {}
72 RunTest<2>({ -1.0f, -0.5f, 7.25f, -3.0f, 0.0f, 0.5f, -0.75f },
73 { 0.0f, 0.0f, 6.0f, 0.0f, 0.0f, 0.5f, 0.0f });
77 struct SigmoidFixture : ActivationFixture
79 SigmoidFixture() : ActivationFixture(
"Sigmoid") {}
83 RunTest<2>({ -0.1f, -0.2f, -0.3f, -0.4f, 0.1f, 0.2f, 0.3f },
84 { 0.4750208f, 0.45016602f, 0.42555749f, 0.40131235f, 0.52497917f, 0.54983395f, 0.57444251f });
88 struct SoftplusFixture : ActivationFixture
90 SoftplusFixture() : ActivationFixture(
"Softplus") {}
94 RunTest<2>({ -0.1f, -0.2f, -0.3f, -0.4f, 0.1f, 0.2f, 0.3f },
95 { 0.64439666f, 0.59813893f, 0.55435526f, 0.51301527f, 0.74439669f, 0.7981388f, 0.85435522f });
99 struct TanhFixture : ActivationFixture
101 TanhFixture() : ActivationFixture(
"Tanh") {}
105 RunTest<2>({ -0.1f, -0.2f, -0.3f, -0.4f, 0.1f, 0.2f, 0.3f },
106 { -0.09966799f, -0.19737528f, -0.29131261f, -0.379949f, 0.09966799f, 0.19737528f, 0.29131261f });
void SetupSingleInputSingleOutput(const std::string &inputName, const std::string &outputName)
BOOST_FIXTURE_TEST_CASE(ParseReLu, ReLuFixture)
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_SUITE(TensorflowLiteParser)