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

Function TEST_F

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

Source from the content-addressed store, hash-verified

32namespace {
33
34TEST_F(OpenCLOperationTest, Reshape) {
35 TensorFloat32 src_tensor;
36 src_tensor.shape = BHWC(1, 2, 1, 3);
37 src_tensor.data = {half(0.5f), half(-1.1f), half(-2.2f),
38 half(3.1f), half(1.2f), half(2.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 Reshape operation = CreateReshape(op_def);
49 ASSERT_OK(ExecuteGPUOperation(src_tensor, creation_context_, &operation,
50 BHWC(1, 3, 1, 2), &dst_tensor));
51 EXPECT_THAT(
52 dst_tensor.data,
53 Pointwise(FloatNear(0.0f), {half(0.5f), half(-1.1f), half(-2.2f),
54 half(3.1f), half(1.2f), half(2.9f)}));
55 }
56 }
57}
58
59} // namespace
60} // namespace cl

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected