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