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

Function TEST_F

tensorflow/lite/delegates/gpu/cl/kernels/reshapex4_test.cc:34–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32namespace {
33
34TEST_F(OpenCLOperationTest, Reshapex4) {
35 TensorFloat32 src_tensor;
36 src_tensor.shape = BHWC(1, 1, 1, 8);
37 src_tensor.data = {half(0.5f), half(-1.1f), half(-2.2f), half(3.1f),
38 half(1.2f), half(2.9f), half(4.2f), half(-1.9f)};
39
40 for (auto storage : env_.GetSupportedStorages()) {
41 for (auto precision : env_.GetSupportedPrecisions()) {
42 OperationDef op_def;
43 op_def.precision = precision;
44 auto data_type = DeduceDataTypeFromPrecision(precision);
45 op_def.src_tensors.push_back({data_type, storage});
46 op_def.dst_tensors.push_back({data_type, storage});
47 TensorFloat32 dst_tensor;
48 Reshapex4 operation = CreateReshapex4(op_def);
49 ASSERT_OK(ExecuteGPUOperation(src_tensor, creation_context_, &operation,
50 BHWC(1, 1, 2, 4), &dst_tensor));
51 EXPECT_THAT(dst_tensor.data,
52 Pointwise(FloatNear(0.0f),
53 {half(0.5f), half(-1.1f), half(-2.2f), half(3.1f),
54 half(1.2f), half(2.9f), half(4.2f), half(-1.9f)}));
55 }
56 }
57}
58
59} // namespace
60} // namespace cl

Callers

nothing calls this directly

Calls 7

CreateReshapex4Function · 0.85
ExecuteGPUOperationFunction · 0.85
GetSupportedStoragesMethod · 0.80
halfClass · 0.50
push_backMethod · 0.45

Tested by

no test coverage detected