(self)
| 70 | self.assertAllEqual(expected, gather_val) |
| 71 | |
| 72 | def testSimpleTwoD32(self): |
| 73 | with self.session() as session, self.test_scope(): |
| 74 | data = np.array([[0, 1, 2], [3, 4, 5], [6, 7, 8], [9, 10, 11], |
| 75 | [12, 13, 14]]) |
| 76 | for dtype in self.all_tf_types: |
| 77 | for axis in 0, 1, -1: |
| 78 | params_np = self._buildParams(data, dtype) |
| 79 | params = array_ops.placeholder(dtype=dtype) |
| 80 | # The indices must be in bounds for any axis. |
| 81 | indices = constant_op.constant([0, 1, 0, 2]) |
| 82 | gather_t = array_ops.gather(params, indices, axis=axis) |
| 83 | gather_val = session.run(gather_t, feed_dict={params: params_np}) |
| 84 | expected = constant_op.constant( |
| 85 | np.take(params_np, [0, 1, 0, 2], axis=axis), dtype) |
| 86 | self.assertAllEqual(expected, gather_val) |
| 87 | |
| 88 | def testSimpleTwoD32_Int64Indices(self): |
| 89 | if np.int64 not in self.int_types: |
nothing calls this directly
no test coverage detected