(self)
| 55 | self.assertAllEqual(np_val, gather_val) |
| 56 | |
| 57 | def testScalar2D(self): |
| 58 | with self.session() as session, self.test_scope(): |
| 59 | data = np.array([[0, 1, 2], [3, 4, 5], [6, 7, 8], [9, 10, 11], |
| 60 | [12, 13, 14]]) |
| 61 | for dtype in self.all_tf_types: |
| 62 | for axis in 0, 1, -1: |
| 63 | params_np = self._buildParams(data, dtype) |
| 64 | params = array_ops.placeholder(dtype=dtype) |
| 65 | indices = constant_op.constant(2) |
| 66 | gather_t = array_ops.gather(params, indices, axis=axis) |
| 67 | gather_val = session.run(gather_t, feed_dict={params: params_np}) |
| 68 | expected = constant_op.constant( |
| 69 | np.take(params_np, 2, axis=axis), dtype) |
| 70 | self.assertAllEqual(expected, gather_val) |
| 71 | |
| 72 | def testSimpleTwoD32(self): |
| 73 | with self.session() as session, self.test_scope(): |
nothing calls this directly
no test coverage detected