MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / testSelectAll

Method testSelectAll

tensorflow/python/kernel_tests/slice_op_test.py:117–129  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

115 self.assertAllEqual([1, 2], slice_val)
116
117 def testSelectAll(self):
118 for _ in range(10):
119 with self.cached_session(use_gpu=True):
120 inp = np.random.rand(4, 4, 4, 4).astype("f")
121 a = constant_op.constant(inp, shape=[4, 4, 4, 4], dtype=dtypes.float32)
122
123 slice_explicit_t = array_ops.slice(a, [0, 0, 0, 0], [-1, -1, -1, -1])
124 slice_implicit_t = a[:, :, :, :]
125
126 self.assertAllEqual(inp, self.evaluate(slice_explicit_t))
127 self.assertAllEqual(inp, self.evaluate(slice_implicit_t))
128 self.assertEqual(inp.shape, slice_explicit_t.get_shape())
129 self.assertEqual(inp.shape, slice_implicit_t.get_shape())
130
131 def testSingleDimension(self):
132 for _ in range(10):

Callers

nothing calls this directly

Calls 8

randMethod · 0.80
sliceMethod · 0.80
rangeFunction · 0.50
cached_sessionMethod · 0.45
constantMethod · 0.45
assertAllEqualMethod · 0.45
evaluateMethod · 0.45
get_shapeMethod · 0.45

Tested by

no test coverage detected