/external/tensorflow/tensorflow/contrib/image/python/kernel_tests/ |
D | distort_image_ops_test.py | 44 def _adjust_hue_in_yiq_np(self, x_np, delta_h): argument 57 self.assertEqual(x_np.shape[-1], 3) 58 x_v = x_np.reshape([-1, 3]) 72 return y_v.reshape(x_np.shape) 74 def _adjust_hue_in_yiq_tf(self, x_np, delta_h): argument 76 x = constant_op.constant(x_np) 98 x_np = np.random.rand(*x_shape) * 255. 103 x_np[..., 1] = x_np[..., 0] 105 x_np[..., 2] = x_np[..., 0] 107 x_np[..., 2] = x_np[..., 1] [all …]
|
D | single_image_random_dot_stereograms_ops_test.py | 36 x_np = [[1, 2, 3, 3, 2, 1], 41 x_tf = constant_op.constant(x_np)
|
/external/tensorflow/tensorflow/compiler/tests/ |
D | image_ops_test.py | 109 def _testContrast(self, x_np, y_np, contrast_factor): argument 111 x = array_ops.placeholder(x_np.dtype, shape=x_np.shape) 116 y_tf = y.eval({x: x_np}) 122 x_np = np.array(x_data, dtype=np.float32).reshape(x_shape) / 255. 130 self._testContrast(x_np, y_np, contrast_factor=2.0) 135 x_np = np.array(x_data, dtype=np.uint8).reshape(x_shape) 140 self._testContrast(x_np, y_np, contrast_factor=2.0) 142 def _adjustContrastNp(self, x_np, contrast_factor): argument 143 mean = np.mean(x_np, (1, 2), keepdims=True) 144 y_np = mean + contrast_factor * (x_np - mean) [all …]
|
D | spacetobatch_op_test.py | 93 x_np = [[[[1], [2]], [[3], [4]]]] 96 self._testOne(x_np, block_size, x_out) 100 x_np = [[[[1], [2]], [[3], [4]]]] 105 self._testPad(x_np, paddings, block_size, x_out) 110 x_np = [[[[1, 2, 3], [4, 5, 6]], [[7, 8, 9], [10, 11, 12]]]] 113 self._testOne(x_np, block_size, x_out) 118 x_np = [[[[1], [2], [3], [4]], [[5], [6], [7], [8]], 123 self._testOne(x_np, block_size, x_out) 128 x_np = [[[[1], [2], [3], [4]], [[5], [6], [7], [8]]], 133 self._testOne(x_np, block_size, x_out) [all …]
|
D | self_adjoint_eig_op_test.py | 35 x_np = np.random.uniform( 37 x_np = x_np + np.swapaxes(x_np, -1, -2) 40 e_np, _ = np.linalg.eigh(x_np) 45 e_val, v_val = sess.run([e, v], feed_dict={x_tf: x_np})
|
D | qr_op_test.py | 71 x_np = np.random.uniform( 78 q_tf_val, r_tf_val = sess.run([q_tf, r_tf], feed_dict={x_tf: x_np}) 85 x_reshape = np.reshape(x_np, (-1, x_np.shape[-2], x_np.shape[-1])) 95 self.CheckApproximation(x_np, q_tf_val, r_tf_val)
|
D | svd_op_test.py | 45 x_np = np.random.uniform(low=-1.0, high=1.0, size=shape).astype(dtype) 47 _, s_np, _ = np.linalg.svd(x_np) 52 s_val, u_val, v_val = sess.run([s, u, v], feed_dict={x_tf: x_np}) 66 np.linalg.norm(self._compute_usvt(s_val, u_val, v_val) - x_np), 2e-2)
|
D | variable_ops_test.py | 428 self.x_np = np.array(x).astype(dtype) 437 x = constant_op.constant(self.x_np, dtype=self.dtype) 446 valnp = np.copy(self.x_np)
|
/external/tensorflow/tensorflow/python/kernel_tests/ |
D | spacetodepth_op_test.py | 57 x_np = [[[[1], [2]], [[3], [4]]]] 61 self._testOne(x_np, block_size, x_out, dtype=dtype) 67 x_np = [[[[1], [2], [5], [6]], [[3], [4], [7], [8]], 72 self._testOne(x_np, block_size, x_out) 77 x_np = [[[[1], [2], [5], [6]], [[3], [4], [7], [8]], 81 self._testOne(x_np, block_size, x_out) 86 x_np = [[[[1, 10], [2, 20]], [[3, 30], [4, 40]]]] 89 self._testOne(x_np, block_size, x_out) 94 x_np = [[[[1, 2, 3], [4, 5, 6]], [[7, 8, 9], [10, 11, 12]]]] 97 self._testOne(x_np, block_size, x_out) [all …]
|
D | depthtospace_op_test.py | 58 x_np = [[[[1, 2, 3, 4]]]] 61 self._testOne(x_np, block_size, x_out) 65 x_np = [[[[1, 2, 3, 4]]]] 68 self._testOne(x_np, block_size, x_out, dtype=dtypes.float16) 74 x_np = [[[[1, 2, 3, 4], 83 self._testOne(x_np, block_size, x_out) 99 x_np = [batch_input_elt(i) for i in range(batch_size)] 101 self._testOne(x_np, block_size, x_out) 124 x_np = [[[[1, 10, 2, 20, 3, 30, 4, 40]], 134 self._testOne(x_np, block_size, x_out) [all …]
|
D | spacetobatch_op_test.py | 125 x_np = [[[[1], [2]], [[3], [4]]]] 128 self._testOne(x_np, block_size, x_out) 133 x_np = [[[[1], [2]], [[3], [4]]]] 138 self._testPad(x_np, paddings, block_size, x_out) 144 x_np = [[[[1, 2, 3], [4, 5, 6]], [[7, 8, 9], [10, 11, 12]]]] 147 self._testOne(x_np, block_size, x_out) 153 x_np = [[[[1], [2], [3], [4]], [[5], [6], [7], [8]], 158 self._testOne(x_np, block_size, x_out) 164 x_np = [[[[1], [2], [3], [4]], [[5], [6], [7], [8]]], 169 self._testOne(x_np, block_size, x_out) [all …]
|
D | array_ops_test.py | 298 x_np = 4 301 x_tf = array_ops.reverse_v2(x_np, []).eval() 302 self.assertAllEqual(x_tf, x_np) 305 x_np = np.array([1, 200, 3, 40, 5], dtype=np_dtype) 310 x_tf = array_ops.reverse_v2(x_np, 313 self.assertAllEqual(x_tf, np.asarray(x_np)[::-1]) 316 x_np = np.array([[1, 200, 3], [4, 5, 60]], dtype=np_dtype) 322 x_tf_1 = reverse_f(x_np, constant_op.constant( 324 x_tf_2 = reverse_f(x_np, constant_op.constant( 326 x_tf_3 = reverse_f(x_np, constant_op.constant( [all …]
|
D | batchtospace_op_test.py | 78 x_np = [[[1], [2]], [[3], [4]]] 82 _ = self.batch_to_space(x_np, crops, block_size) 87 x_np = [[[[1], [2]], [[3], [4]]]] 91 out_tf = self.batch_to_space(x_np, crops, block_size) 97 x_np = [[[[1], [2]], [[3], [4]]]] 101 out_tf = self.batch_to_space(x_np, crops, block_size) 107 x_np = [[[[1], [2]], [[3], [4]]]] 111 out_tf = self.batch_to_space(x_np, crops, block_size) 117 x_np = [[[[1], [2], [3]], [[3], [4], [7]]]] 121 _ = self.batch_to_space(x_np, crops, block_size)
|
D | qr_op_test.py | 122 x_np = np.random.uniform( 125 x_np += 1j * np.random.uniform( 131 x_tf = constant_op.constant(x_np) 139 q_tf_val, r_tf_val = sess.run([q_tf, r_tf], feed_dict={x_tf: x_np}) 146 x_reshape = np.reshape(x_np, (-1, x_np.shape[-2], x_np.shape[-1])) 156 CheckApproximation(self, x_np, q_tf_val, r_tf_val)
|
D | svd_op_test.py | 142 x_np = np.random.uniform( 145 x_np += 1j * np.random.uniform( 151 x_tf = constant_op.constant(x_np) 162 [s_tf, u_tf, v_tf], feed_dict={x_tf: x_np}) 169 s_tf_val = sess.run(s_tf, feed_dict={x_tf: x_np}) 173 x_np, compute_uv=compute_uv_, full_matrices=full_matrices_) 176 x_np, compute_uv=compute_uv_, full_matrices=full_matrices_) 187 CheckApproximation(self, x_np, u_tf_val, s_tf_val, v_tf_val,
|
D | shape_ops_test.py | 64 def _compareShapeSparse(self, x_np, use_gpu=False): argument 65 np_ans = np.array(np.shape(x_np)) 66 x_tf, unused_nnz = _sparsify(x_np) 93 def _compareRankSparse(self, x_np, use_gpu=False): argument 94 np_ans = np.asarray(np.ndim(x_np)) 95 x_tf, unused_nnz = _sparsify(x_np) 113 def _compareSizeSparse(self, x_np, use_gpu=False): argument 114 np_ans = np.asarray(np.size(x_np)) 115 x_tf, unused_nnz = _sparsify(x_np)
|
/external/tensorflow/tensorflow/contrib/solvers/python/kernel_tests/ |
D | util_test.py | 34 x_np = np.array([[2.], [-3.]], dtype=dtype) 39 x = constant_op.constant(x_np, dtype=dtype) 54 x: x_np, 57 self.assertAllClose(ax_val, np.dot(a_np, x_np)) 69 x_np = np.array([[2.], [-3.]], dtype=dtype) 74 x = constant_op.constant(x_np, dtype=dtype) 90 x: x_np, 94 self.assertAllClose(ax_val, x_np) 105 x_np = np.array([[2], [-3.], [5.]]) 106 x_norm_np = np.linalg.norm(x_np) [all …]
|
D | linear_equations_test.py | 55 x_np = np.zeros_like(rhs_np) 62 x = constant_op.constant(x_np) 91 x: x_np,
|
/external/tensorflow/tensorflow/python/ops/ |
D | image_ops_test.py | 173 def _TestRGBToGrayscale(self, x_np): argument 174 y_np = self._RGBToGrayscale(x_np) 177 x_tf = constant_op.constant(x_np, shape=x_np.shape) 184 x_np = np.array( 186 self._TestRGBToGrayscale(x_np) 189 x_np = np.array([[1, 2, 3], [4, 10, 1]], dtype=np.uint8).reshape([1, 2, 3]) 190 self._TestRGBToGrayscale(x_np) 194 x_np = np.array([[1, 2]], dtype=np.uint8).reshape([1, 1, 2, 1]) 199 x_tf = constant_op.constant(x_np, shape=x_np.shape) 205 x_np = np.array([[1, 2]], dtype=np.uint8).reshape([1, 2, 1]) [all …]
|
D | math_ops_test.py | 99 x_np = np.random.rand(5, 5).astype(dtype) 101 y_tf_np = math_ops.reduce_logsumexp(x_np).eval() 102 y_np = log(np.sum(exp(x_np))) 107 x_np = np.random.rand(5, 5).astype(dtype) 109 y_tf = math_ops.reduce_logsumexp(x_np, axis=[0]) 110 y_np = log(np.sum(exp(x_np), axis=0)) 117 x_np = np.random.rand(5, 5).astype(dtype) 119 y_tf = math_ops.reduce_logsumexp(x_np, axis=0) 120 y_np = log(np.sum(exp(x_np), axis=0)) 128 x_np = np.random.rand(5, 5).astype(dtype) [all …]
|
D | nn_test.py | 57 x_np = np.random.randint(0, 2, size=x_shape).astype(np.float32) 58 y_np = self._ZeroFraction(x_np) 60 x_tf = constant_op.constant(x_np) 108 x_np = np.random.randn(*x_shape).astype(np.float32) 109 y_np = self._softmax(x_np) 110 x_tf = constant_op.constant(x_np) 134 x_np = np.random.randn(*x_shape).astype(np.float64) 136 x_tf = constant_op.constant(x_np) 156 x_np = np.random.randn(*x_shape).astype(np.float32) 158 y_np = self._log_poisson_loss(x_np, z_np, compute_full_loss=False) [all …]
|
/external/tensorflow/tensorflow/contrib/nn/python/ops/ |
D | scaled_softplus_test.py | 50 x_np = np.random.randn(*x_shape).astype(np.float32) 54 x_tf = constant_op.constant(x_np) 62 [x_np, alpha_np], 68 [x_np, alpha_np, clip_np],
|
/external/tensorflow/tensorflow/python/keras/layers/ |
D | recurrent_test.py | 188 x_np = np.random.random((6, 5, 5)) 189 y_np = model.predict(x_np) 197 y_np_2 = model.predict(x_np) 214 x_np = np.random.random((6, 5, 5)) 215 y_np = model.predict(x_np) 223 y_np_2 = model.predict(x_np) 362 x_np = np.random.random((batch, time_step, embedding_dim)) 363 y_np_1 = model.predict(x_np) 376 y_np_2 = model_2.predict(x_np) 440 x_np = np.random.random((6, 5, 5)) [all …]
|
D | wrappers_test.py | 605 x_np = np.random.random((6, 5, 5)) 607 y_np = model.predict([x_np, c_np]) 616 y_np_2 = model.predict([x_np, c_np]) 625 y_np_3 = model.predict([x_np, c_np]) 651 x_np = np.random.random((6, 5, 5)) 655 y_np = model.predict([x_np, s_fw_np, s_bk_np, c_np]) 664 y_np_2 = model.predict([x_np, s_fw_np, s_bk_np, c_np]) 669 [x_np, s_fw_np + 10., s_bk_np + 10., c_np]) 678 y_np_3 = model.predict([x_np, s_fw_np, s_bk_np, c_np])
|
/external/tensorflow/tensorflow/python/kernel_tests/signal/ |
D | fft_ops_test.py | 49 x_np = self._npFFT(x, rank, fft_length) 56 self.assertAllClose(x_np, x_tf, rtol=rtol, atol=atol) 60 x_np = self._npIFFT(x, rank, fft_length) 67 self.assertAllClose(x_np, x_tf, rtol=rtol, atol=atol)
|