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

Function TEST_F

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

Source from the content-addressed store, hash-verified

32namespace {
33
34TEST_F(OpenCLOperationTest, Abs) {
35 TensorFloat32 src_tensor;
36 src_tensor.shape = BHWC(1, 2, 1, 2);
37 src_tensor.data = {half(0.0f), half(-1.0f), half(-0.05f), half(0.045f)};
38
39 for (auto storage : env_.GetSupportedStorages()) {
40 for (auto precision : env_.GetSupportedPrecisions()) {
41 OperationDef op_def;
42 op_def.precision = precision;
43 auto data_type = DeduceDataTypeFromPrecision(precision);
44 op_def.src_tensors.push_back({data_type, storage});
45 op_def.dst_tensors.push_back({data_type, storage});
46 TensorFloat32 dst_tensor;
47 Abs operation = CreateAbs(op_def);
48 ASSERT_OK(ExecuteGPUOperation(src_tensor, creation_context_, &operation,
49 BHWC(1, 2, 1, 2), &dst_tensor));
50 EXPECT_THAT(dst_tensor.data,
51 Pointwise(FloatNear(0.0f), {half(0.0f), half(1.0f),
52 half(0.05f), half(0.045f)}));
53 }
54 }
55}
56
57} // namespace
58} // namespace cl

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected