/external/tensorflow/tensorflow/contrib/image/python/kernel_tests/ |
distort_image_ops_test.py | 44 def _adjust_hue_in_yiq_np(self, x_np, delta_h): 51 x_np: input x with last dimension = 3. 55 Adjusted y with the same shape as x_np. 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): 76 x = constant_op.constant(x_np) 98 x_np = np.random.rand(*x_shape) * 255. 103 x_np[..., 1] = x_np[..., 0 [all...] |
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/ |
image_ops_test.py | 103 def _testContrast(self, x_np, y_np, contrast_factor): 105 x = array_ops.placeholder(x_np.dtype, shape=x_np.shape) 110 y_tf = y.eval({x: x_np}) 116 x_np = np.array(x_data, dtype=np.float32).reshape(x_shape) / 255. 124 self._testContrast(x_np, y_np, contrast_factor=2.0) 129 x_np = np.array(x_data, dtype=np.uint8).reshape(x_shape) 134 self._testContrast(x_np, y_np, contrast_factor=2.0) 136 def _adjustContrastNp(self, x_np, contrast_factor): 137 mean = np.mean(x_np, (1, 2), keepdims=True [all...] |
spacetobatch_op_test.py | 92 x_np = [[[[1], [2]], [[3], [4]]]] 95 self._testOne(x_np, block_size, x_out) 99 x_np = [[[[1], [2]], [[3], [4]]]] 104 self._testPad(x_np, paddings, block_size, x_out) 109 x_np = [[[[1, 2, 3], [4, 5, 6]], [[7, 8, 9], [10, 11, 12]]]] 112 self._testOne(x_np, block_size, x_out) 117 x_np = [[[[1], [2], [3], [4]], [[5], [6], [7], [8]], 122 self._testOne(x_np, block_size, x_out) 127 x_np = [[[[1], [2], [3], [4]], [[5], [6], [7], [8]]], 132 self._testOne(x_np, block_size, x_out [all...] |
variable_ops_test.py | 197 self.x_np = np.array(x).astype(dtype) 206 x = constant_op.constant(self.x_np, dtype=self.dtype) 215 valnp = np.copy(self.x_np)
|
/external/tensorflow/tensorflow/python/kernel_tests/ |
spacetodepth_op_test.py | 56 x_np = [[[[1], [2]], [[3], [4]]]] 59 self._testOne(x_np, block_size, x_out) 64 x_np = [[[[1], [2], [5], [6]], [[3], [4], [7], [8]], 69 self._testOne(x_np, block_size, x_out) 74 x_np = [[[[1], [2], [5], [6]], [[3], [4], [7], [8]], 78 self._testOne(x_np, block_size, x_out) 83 x_np = [[[[1, 10], [2, 20]], [[3, 30], [4, 40]]]] 86 self._testOne(x_np, block_size, x_out) 91 x_np = [[[[1, 2, 3], [4, 5, 6]], [[7, 8, 9], [10, 11, 12]]]] 94 self._testOne(x_np, block_size, x_out [all...] |
depthtospace_op_test.py | 57 x_np = [[[[1, 2, 3, 4]]]] 60 self._testOne(x_np, block_size, x_out) 65 x_np = [[[[1, 2, 3, 4], 74 self._testOne(x_np, block_size, x_out) 89 x_np = [batch_input_elt(i) for i in range(batch_size)] 91 self._testOne(x_np, block_size, x_out) 95 x_np = [[[[1, 10, 2, 20, 3, 30, 4, 40]], 105 self._testOne(x_np, block_size, x_out) 110 x_np = [[[[1, 2, 5, 6, 3, 4, 7, 8, 9, 10, 13, 14, 11, 12, 15, 16]]]] 116 self._testOne(x_np, block_size, x_out [all...] |
spacetobatch_op_test.py | 119 x_np = [[[[1], [2]], [[3], [4]]]] 122 self._testOne(x_np, block_size, x_out) 126 x_np = [[[[1], [2]], [[3], [4]]]] 131 self._testPad(x_np, paddings, block_size, x_out) 136 x_np = [[[[1, 2, 3], [4, 5, 6]], [[7, 8, 9], [10, 11, 12]]]] 139 self._testOne(x_np, block_size, x_out) 144 x_np = [[[[1], [2], [3], [4]], [[5], [6], [7], [8]], 149 self._testOne(x_np, block_size, x_out) 154 x_np = [[[[1], [2], [3], [4]], [[5], [6], [7], [8]]], 159 self._testOne(x_np, block_size, x_out [all...] |
qr_op_test.py | 117 x_np = np.random.uniform( 120 x_np += 1j * np.random.uniform( 126 x_tf = constant_op.constant(x_np) 134 q_tf_val, r_tf_val = sess.run([q_tf, r_tf], feed_dict={x_tf: x_np}) 141 x_reshape = np.reshape(x_np, (-1, x_np.shape[-2], x_np.shape[-1])) 151 CheckApproximation(self, x_np, q_tf_val, r_tf_val)
|
array_ops_test.py | 277 x_np = 4 280 x_tf = array_ops.reverse_v2(x_np, []).eval() 281 self.assertAllEqual(x_tf, x_np) 284 x_np = np.array([1, 200, 3, 40, 5], dtype=np_dtype) 289 x_tf = array_ops.reverse_v2(x_np, 292 self.assertAllEqual(x_tf, np.asarray(x_np)[::-1]) 295 x_np = np.array([[1, 200, 3], [4, 5, 60]], dtype=np_dtype) 301 x_tf_1 = reverse_f(x_np, constant_op.constant( 303 x_tf_2 = reverse_f(x_np, constant_op.constant( 305 x_tf_3 = reverse_f(x_np, constant_op.constant [all...] |
batchtospace_op_test.py | 75 x_np = [[[1], [2]], [[3], [4]]] 79 _ = self.batch_to_space(x_np, crops, block_size) 83 x_np = [[[[1], [2]], [[3], [4]]]] 87 out_tf = self.batch_to_space(x_np, crops, block_size) 92 x_np = [[[[1], [2]], [[3], [4]]]] 96 out_tf = self.batch_to_space(x_np, crops, block_size) 101 x_np = [[[[1], [2]], [[3], [4]]]] 105 out_tf = self.batch_to_space(x_np, crops, block_size) 110 x_np = [[[[1], [2], [3]], [[3], [4], [7]]]] 114 _ = self.batch_to_space(x_np, crops, block_size [all...] |
svd_op_test.py | 136 x_np = np.random.uniform( 139 x_np += 1j * np.random.uniform( 145 x_tf = constant_op.constant(x_np) 156 [s_tf, u_tf, v_tf], feed_dict={x_tf: x_np}) 163 s_tf_val = sess.run(s_tf, feed_dict={x_tf: x_np}) 167 x_np, compute_uv=compute_uv_, full_matrices=full_matrices_) 170 x_np, compute_uv=compute_uv_, full_matrices=full_matrices_) 181 CheckApproximation(self, x_np, u_tf_val, s_tf_val, v_tf_val,
|
shape_ops_test.py | 62 def _compareShapeSparse(self, x_np, use_gpu=False): 63 np_ans = np.array(np.shape(x_np)) 64 x_tf, unused_nnz = _sparsify(x_np) 91 def _compareRankSparse(self, x_np, use_gpu=False): 92 np_ans = np.asarray(np.ndim(x_np)) 93 x_tf, unused_nnz = _sparsify(x_np) 111 def _compareSizeSparse(self, x_np, use_gpu=False): 112 np_ans = np.asarray(np.size(x_np)) 113 x_tf, unused_nnz = _sparsify(x_np)
|
fft_ops_test.py | 46 x_np = self._npFFT(x, rank, fft_length) 53 self.assertAllClose(x_np, x_tf, rtol=1e-4, atol=1e-4) 56 x_np = self._npIFFT(x, rank, fft_length) 63 self.assertAllClose(x_np, x_tf, rtol=1e-4, atol=1e-4)
|
transpose_op_test.py | 400 x_np = [[1, 2, 3], [4, 5, 6]] 403 x_tf = array_ops.transpose(x_np).eval()
|
/external/tensorflow/tensorflow/contrib/solvers/python/kernel_tests/ |
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...] |
linear_equations_test.py | 54 x_np = np.zeros_like(rhs_np) 61 x = constant_op.constant(x_np) 90 x: x_np,
|
/external/tensorflow/tensorflow/python/ops/ |
image_ops_test.py | 167 def _TestRGBToGrayscale(self, x_np): 168 y_np = self._RGBToGrayscale(x_np) 171 x_tf = constant_op.constant(x_np, shape=x_np.shape) 178 x_np = np.array( 180 self._TestRGBToGrayscale(x_np) 183 x_np = np.array([[1, 2, 3], [4, 10, 1]], dtype=np.uint8).reshape([1, 2, 3]) 184 self._TestRGBToGrayscale(x_np) 188 x_np = np.array([[1, 2]], dtype=np.uint8).reshape([1, 1, 2, 1]) 193 x_tf = constant_op.constant(x_np, shape=x_np.shape [all...] |
math_ops_test.py | 78 x_np = np.random.rand(5, 5).astype(dtype) 80 y_tf_np = math_ops.reduce_logsumexp(x_np).eval() 81 y_np = log(np.sum(exp(x_np))) 86 x_np = np.random.rand(5, 5).astype(dtype) 88 y_tf = math_ops.reduce_logsumexp(x_np, reduction_indices=[0]) 89 y_np = log(np.sum(exp(x_np), axis=0)) 96 x_np = np.random.rand(5, 5).astype(dtype) 98 y_tf = math_ops.reduce_logsumexp(x_np, reduction_indices=0) 99 y_np = log(np.sum(exp(x_np), axis=0)) 106 x_np = np.random.rand(5, 5).astype(dtype [all...] |
nn_test.py | 53 x_np = np.random.randint(0, 2, size=x_shape).astype(np.float32) 54 y_np = self._ZeroFraction(x_np) 56 x_tf = constant_op.constant(x_np) 82 x_np = np.random.randn(*x_shape).astype(np.float32) 83 y_np = self._softmax(x_np) 84 x_tf = constant_op.constant(x_np) 107 x_np = np.random.randn(*x_shape).astype(np.float64) 109 x_tf = constant_op.constant(x_np) 129 x_np = np.random.randn(*x_shape).astype(np.float32) 131 y_np = self._log_poisson_loss(x_np, z_np, compute_full_loss=False [all...] |
check_ops.py | 357 x_np = x.numpy().reshape((-1,)) 359 x_sum = min(x_np.size, summarize) 363 (x_sum, x_np[:x_sum], [all...] |
/external/tensorflow/tensorflow/python/keras/_impl/keras/layers/ |
recurrent_test.py | 147 x_np = np.random.random((6, 5, 5)) variable in class:RNNTest.test_minimal_rnn_cell_layer.MinimalRNNCell 148 y_np = model.predict(x_np) 156 y_np_2 = model.predict(x_np) 170 x_np = np.random.random((6, 5, 5)) variable in class:RNNTest.test_minimal_rnn_cell_layer.MinimalRNNCell 171 y_np = model.predict(x_np) 179 y_np_2 = model.predict(x_np) 241 x_np = np.random.random((6, 5, 5)) variable in class:RNNTest.test_rnn_cell_with_constants_layer.RNNCellWithConstants 243 y_np = model.predict([x_np, c_np]) 252 y_np_2 = model.predict([x_np, c_np]) 262 y_np_3 = model.predict([x_np, c_np] 281 x_np = np.random.random((6, 5, 5)) variable in class:RNNTest.test_rnn_cell_with_constants_layer.RNNCellWithConstants 354 x_np = np.random.random((6, 5, 5)) variable in class:RNNTest.test_rnn_cell_with_constants_layer_passing_initial_state.RNNCellWithConstants [all...] |
/external/tensorflow/tensorflow/contrib/nn/python/ops/ |
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/_impl/keras/engine/ |
training_eager_test.py | 521 x_np = np.random.random((10, 3)) 525 model.fit(x_np, [y_np, y_np], epochs=1, sample_weight={'1': w_np}) 528 model.fit(x_np, [y_np, y_np], epochs=1, sample_weight=[w_np]) 530 model.fit(x_np, [y_np, y_np], epochs=1, sample_weight=w_np) 533 model.fit(x_np, [y_np, y_np], epochs=1, sample_weight={'1': bad_w_np}) 536 model.fit(x_np, [y_np, y_np], epochs=1, sample_weight={'1': bad_w_np}) 539 model.fit(x_np, [y_np, y_np], epochs=1, sample_weight={'1': bad_w_np})
|
training_test.py | 663 x_np = np.random.random((10, 3)) 667 model.fit(x_np, [y_np, y_np], epochs=1, 671 model.fit(x_np, [y_np, y_np], epochs=1, 674 model.fit(x_np, [y_np, y_np], epochs=1, 678 model.fit(x_np, [y_np, y_np], epochs=1, 682 model.fit(x_np, [y_np, y_np], epochs=1, 686 model.fit(x_np, [y_np, y_np], epochs=1, [all...] |