MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / TEST

Function TEST

tensorflow/lite/delegates/gpu/gl/kernels/softmax_test.cc:34–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32namespace {
33
34TEST(SoftmaxTest, Softmax) {
35 TensorRef<BHWC> input;
36 input.type = DataType::FLOAT32;
37 input.ref = 0;
38 input.shape = BHWC(1, 2, 2, 1);
39
40 TensorRef<BHWC> output;
41 output.type = DataType::FLOAT32;
42 output.ref = 1;
43 output.shape = BHWC(1, 2, 2, 1);
44
45 SoftmaxAttributes attr;
46 attr.axis = Axis::CHANNELS;
47
48 SingleOpModel model({ToString(OperationType::SOFTMAX), attr}, {input},
49 {output});
50 ASSERT_TRUE(model.PopulateTensor(0, {0.1, 0.2, 0.1, 0.2}));
51 ASSERT_OK(model.Invoke(*NewSoftmaxNodeShader()));
52 EXPECT_THAT(model.GetOutput(0), Pointwise(FloatNear(1e-6), {1, 1, 1, 1}));
53}
54
55TEST(SoftmaxTest, DoesNotWorkForHeightAxis) {
56 TensorRef<BHWC> input;

Callers

nothing calls this directly

Calls 7

NewSoftmaxNodeShaderFunction · 0.85
ToStringFunction · 0.50
expFunction · 0.50
PopulateTensorMethod · 0.45
InvokeMethod · 0.45
GetOutputMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected