| 31 | namespace { |
| 32 | |
| 33 | TEST(MulTest, Scalar) { |
| 34 | TensorRef<BHWC> input; |
| 35 | input.type = DataType::FLOAT32; |
| 36 | input.ref = 0; |
| 37 | input.shape = BHWC(1, 2, 2, 1); |
| 38 | |
| 39 | TensorRef<BHWC> output; |
| 40 | output.type = DataType::FLOAT32; |
| 41 | output.ref = 1; |
| 42 | output.shape = BHWC(1, 2, 2, 1); |
| 43 | |
| 44 | MultiplyScalarAttributes attr; |
| 45 | attr.param = 2; |
| 46 | |
| 47 | SingleOpModel model({ToString(OperationType::MUL), attr}, {input}, {output}); |
| 48 | ASSERT_TRUE(model.PopulateTensor(0, {1, 2, 3, 4})); |
| 49 | ASSERT_OK(model.Invoke(*NewMultiplyScalarNodeShader())); |
| 50 | EXPECT_THAT(model.GetOutput(0), Pointwise(FloatNear(1e-6), {2, 4, 6, 8})); |
| 51 | } |
| 52 | |
| 53 | TEST(MulTest, Linear) { |
| 54 | TensorRef<BHWC> input; |
no test coverage detected