| 51 | }; |
| 52 | |
| 53 | TEST_F(GatherOpTest, ScalarIndices) { |
| 54 | MakeOp(DT_FLOAT, DT_INT32); |
| 55 | |
| 56 | // Feed and run |
| 57 | AddInputFromArray<float>(TensorShape({5}), {0, 1, 2, 3, 4}); |
| 58 | AddInputFromArray<int32>(TensorShape({}), {3}); |
| 59 | AddInputFromArray<int32>(TensorShape({}), {0}); |
| 60 | TF_ASSERT_OK(RunOpKernel()); |
| 61 | |
| 62 | // Check the output. |
| 63 | Tensor expected(allocator(), DT_FLOAT, TensorShape({})); |
| 64 | test::FillValues<float>(&expected, {3}); |
| 65 | test::ExpectTensorEqual<float>(expected, *GetOutput(0)); |
| 66 | } |
| 67 | |
| 68 | TEST_F(GatherOpTest, ScalarIndices_Complex) { |
| 69 | MakeOp(DT_COMPLEX64, DT_INT32); |
nothing calls this directly
no test coverage detected