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

Function TEST

tensorflow/lite/delegates/gpu/gl/kernels/mul_test.cc:33–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31namespace {
32
33TEST(MulTest, Scalar) {
34 TensorRef<BHWC> input;
35 input.type = DataType::FLOAT32;
36 input.ref = 0;
37 input.shape = BHWC(1, 2, 2, 1);
38
39 TensorRef<BHWC> output;
40 output.type = DataType::FLOAT32;
41 output.ref = 1;
42 output.shape = BHWC(1, 2, 2, 1);
43
44 MultiplyScalarAttributes attr;
45 attr.param = 2;
46
47 SingleOpModel model({ToString(OperationType::MUL), attr}, {input}, {output});
48 ASSERT_TRUE(model.PopulateTensor(0, {1, 2, 3, 4}));
49 ASSERT_OK(model.Invoke(*NewMultiplyScalarNodeShader()));
50 EXPECT_THAT(model.GetOutput(0), Pointwise(FloatNear(1e-6), {2, 4, 6, 8}));
51}
52
53TEST(MulTest, Linear) {
54 TensorRef<BHWC> input;

Callers 1

Calls 6

NewApplyMaskNodeShaderFunction · 0.85
ToStringFunction · 0.50
PopulateTensorMethod · 0.45
InvokeMethod · 0.45
GetOutputMethod · 0.45

Tested by

no test coverage detected