| 32 | namespace { |
| 33 | |
| 34 | TEST_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 |
nothing calls this directly
no test coverage detected