Home
last modified time | relevance | path

Searched refs:x_np (Results 1 – 25 of 31) sorted by relevance

12

/external/tensorflow/tensorflow/contrib/image/python/kernel_tests/
Ddistort_image_ops_test.py44 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 …]
Dsingle_image_random_dot_stereograms_ops_test.py36 x_np = [[1, 2, 3, 3, 2, 1],
41 x_tf = constant_op.constant(x_np)
/external/tensorflow/tensorflow/compiler/tests/
Dimage_ops_test.py109 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 …]
Dspacetobatch_op_test.py93 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 …]
Dself_adjoint_eig_op_test.py35 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})
Dqr_op_test.py71 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)
Dsvd_op_test.py45 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)
Dvariable_ops_test.py428 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/
Dspacetodepth_op_test.py57 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 …]
Ddepthtospace_op_test.py58 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 …]
Dspacetobatch_op_test.py125 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 …]
Darray_ops_test.py298 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 …]
Dbatchtospace_op_test.py78 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)
Dqr_op_test.py122 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)
Dsvd_op_test.py142 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,
Dshape_ops_test.py64 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/
Dutil_test.py34 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 …]
Dlinear_equations_test.py55 x_np = np.zeros_like(rhs_np)
62 x = constant_op.constant(x_np)
91 x: x_np,
/external/tensorflow/tensorflow/python/ops/
Dimage_ops_test.py173 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 …]
Dmath_ops_test.py99 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 …]
Dnn_test.py57 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/
Dscaled_softplus_test.py50 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/
Drecurrent_test.py188 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 …]
Dwrappers_test.py605 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/
Dfft_ops_test.py49 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)

12