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

Function TEST

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

Source from the content-addressed store, hash-verified

31namespace {
32
33TEST(ConcatTest, TwoInputTensorsByUnalignedChannel) {
34 TensorRef<BHWC> input1, input2, output;
35 input1.type = DataType::FLOAT32;
36 input1.ref = 0;
37 input1.shape = BHWC(1, 2, 2, 1);
38
39 input2.type = DataType::FLOAT32;
40 input2.ref = 1;
41 input2.shape = BHWC(1, 2, 2, 1);
42
43 output.type = DataType::FLOAT32;
44 output.ref = 2;
45 output.shape = BHWC(1, 2, 2, 2);
46
47 ConcatAttributes attr;
48 attr.axis = Axis::CHANNELS;
49
50 SingleOpModel model({ToString(OperationType::CONCAT), attr}, {input1, input2},
51 {output});
52 ASSERT_TRUE(model.PopulateTensor(0, {1, 3, 5, 7}));
53 ASSERT_TRUE(model.PopulateTensor(1, {2, 4, 6, 8}));
54 ASSERT_OK(model.Invoke(*NewConcatNodeShader()));
55 EXPECT_THAT(model.GetOutput(0),
56 Pointwise(FloatNear(1e-6), {1, 2, 3, 4, 5, 6, 7, 8}));
57}
58
59TEST(ConcatTest, TwoInputTensorsByAlignedChannel) {
60 TensorRef<BHWC> input1, input2, output;

Callers

nothing calls this directly

Calls 7

NewConcatNodeShaderFunction · 0.85
NewFlatConcatNodeShaderFunction · 0.85
ToStringFunction · 0.50
PopulateTensorMethod · 0.45
InvokeMethod · 0.45
GetOutputMethod · 0.45

Tested by

no test coverage detected