/external/tensorflow/tensorflow/python/kernel_tests/ |
sparse_to_dense_op_py_test.py | 47 np_ans = np.array([0, 1, 0, 1, 0]).astype(np.int32) 48 self.assertAllClose(np_ans, tf_ans) 53 np_ans = np.array([0, 1, 0, 1, 0]).astype(np.float32) 54 self.assertAllClose(np_ans, tf_ans) 59 np_ans = np.array(["b", "a", "b", "a", "b"]).astype(np.string_) 60 self.assertAllEqual(np_ans, tf_ans) 65 np_ans = np.array([-1, 1, -1, 2, -1]).astype(np.int32) 66 self.assertAllClose(np_ans, tf_ans) 71 np_ans = np.array([-1, 1, -1, 1, -1]).astype(np.int32) 72 self.assertAllClose(np_ans, tf_ans [all...] |
clip_ops_test.py | 33 np_ans = [[-4.4, 2.0, 3.0], [4.0, 4.4, 4.4]] 38 self.assertAllClose(np_ans, tf_ans) 53 np_ans = [float('NaN'), 4.0, -4.0] 58 self.assertAllClose(np_ans, tf_ans) 66 np_ans = [[-2.4, 0.0, 0.0], [3.2, 0.0, 0.0]] 75 self.assertAllClose(np_ans, tf_ans) 76 self.assertAllClose(np_ans, tf_ans_tensor) 91 np_ans = [[-3.0, 0.0, 0.0], [4.0, 0.0, 0.0]] 96 self.assertAllClose(np_ans, tf_ans) 103 np_ans = [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0] [all...] |
in_topk_op_test.py | 32 np_ans = np.array(expected) 36 self.assertAllClose(np_ans, out) 37 self.assertShapeEqual(np_ans, precision) 77 np_ans = np.array([False, True]) 81 self.assertAllClose(np_ans, out) 82 self.assertShapeEqual(np_ans, precision)
|
constant_op_eager_test.py | 38 np_ans = np.array(x) 41 if np_ans.dtype in [np.float32, np.float64, np.complex64, np.complex128]: 42 self.assertAllClose(np_ans, tf_ans) 44 self.assertAllEqual(np_ans, tf_ans) 49 np_ans = np.array(x) 52 if np_ans.dtype in [np.float32, np.float64, np.complex64, np.complex128]: 53 self.assertAllClose(np_ans, tf_ans) 55 self.assertAllEqual(np_ans, tf_ans) 314 np_ans = np.array([[0] * 3] * 2) 320 self.assertAllEqual(np_ans, out [all...] |
constant_op_test.py | 44 np_ans = np.array(x) 47 dtype = dtypes_lib.as_dtype(np_ans.dtype) 49 self.assertAllClose(np_ans, tf_ans) 51 self.assertAllEqual(np_ans, tf_ans) 54 np_ans = np.array(x) 57 dtype = dtypes_lib.as_dtype(np_ans.dtype) 59 self.assertAllClose(np_ans, tf_ans) 61 self.assertAllEqual(np_ans, tf_ans) 376 np_ans = np.array([[0] * 3] * 2) 383 self.assertAllEqual(np_ans, out [all...] |
trace_op_test.py | 32 np_ans = np.trace(x, axis1=-2, axis2=-1) 35 self.assertAllClose(tf_ans, np_ans)
|
transpose_op_test.py | 42 np_ans = self._np_transpose(x, p) 44 np_ans = np.conj(np_ans) 49 self.assertShapeEqual(np_ans, y) 50 self.assertAllEqual(np_ans, tf_ans) 68 np_ans = self._np_transpose(x, p) 70 np_ans = np.conj(np_ans) 76 self.assertAllEqual(np_ans, tf_ans) 77 self.assertShapeEqual(np_ans, y [all...] |
determinant_op_test.py | 40 np_ans = np.ones(shape[:-2]).astype(matrix_x.dtype) 42 np_ans = np.array(np.linalg.det(matrix_x)).astype(matrix_x.dtype) 43 self.assertShapeEqual(np_ans, tf_ans) 44 self.assertAllClose(np_ans, out, atol=5e-5) 50 np_sign, np_ans = (1.0, np.zeros(shape[:-2]).astype(matrix_x.dtype)) 52 np_sign, np_ans = np.linalg.slogdet(matrix_x) 53 np_ans = np_ans.astype(matrix_x.dtype) 55 self.assertShapeEqual(np_ans, abs_log_det_tf) 60 np_sign * np.exp(np_ans), [all...] |
shape_ops_test.py | 52 np_ans = np.array(np.shape(x)) 58 self.assertAllEqual(np_ans, result) 59 self.assertAllEqual(np_ans, result_64) 60 self.assertShapeEqual(np_ans, tf_ans) 63 np_ans = np.array(np.shape(x_np)) 68 self.assertAllEqual(np_ans, result) 69 self.assertShapeEqual(np_ans, tf_ans) 72 np_ans = np.array(np.shape(x)) 79 self.assertAllEqual(np_ans, result[i]) 80 self.assertAllEqual(np_ans, result_64[i] [all...] |
reduction_ops_test.py | 132 np_ans = self._np_reduce(x, reduction_axes, keepdims) 136 self.assertAllClose(np_ans, out) 137 self.assertShapeEqual(np_ans, tf_ans) 553 np_ans = x 555 np_ans = np.amin(np_ans, keepdims=keepdims) 558 np_ans = np.amin(np_ans, axis=ra, keepdims=keepdims) 564 self.assertAllClose(np_ans, out) 565 self.assertShapeEqual(np_ans, tf_ans [all...] |
tensordot_op_test.py | 98 np_ans = np.tensordot(np_a, np_b, axes_value) 104 self.assertAllEqual(tf_ans.shape, np_ans.shape) 105 self.assertAllEqual(tf_ans, np_ans) 167 np_ans = np.tensordot(a_np, b_np, axes=(a_dims_np, b_dims_np)) 182 self.assertAllClose(tf_ans, np_ans, rtol=tol, atol=tol) 183 self.assertAllEqual(tf_ans.shape, np_ans.shape) 203 np_ans = np.tensordot(a_np, b_np, axes=axes) 212 self.assertAllClose(tf_ans, np_ans, rtol=tol, atol=tol) 213 self.assertAllEqual(tf_ans.shape, np_ans.shape)
|
matrix_exponential_op_test.py | 53 np_ans = np.empty(x.shape, dtype=np_type) 56 np_ans = np.zeros(inp.shape, dtype=np_type) 58 np_ans[i] = np_expm(inp[i]) 60 np_ans = np_expm(inp) 62 self.assertAllClose(np_ans, out, rtol=1e-4, atol=1e-3)
|
matrix_triangular_solve_op_test.py | 84 np_ans = np.linalg.solve(a_np, b) 91 np_ans = np.linalg.solve(a_np, b) 92 self.assertEqual(np_ans.shape, tf_ans.get_shape()) 93 self.assertEqual(np_ans.shape, tf_val.shape) 94 self.assertAllClose(np_ans, tf_val)
|
segment_reduction_ops_test.py | 117 np_ans = self._segmentReduce(indices, np_x, np_op1, np_op2) 120 self.assertAllClose(np_ans, tf_ans) 125 self.assertAllEqual(np_ans.shape[1:], tf_ans.shape[1:]) 160 np_ans = self._segmentReduce(indices, np_x, np.add) 163 self.assertAllClose(np_ans, tf_ans) 171 np_ans = self._segmentReduce(indices, np_x, np.add) 174 self.assertAllClose(np_ans, tf_ans) 292 np_ans = self._segmentReduce( 299 self.assertAllClose(np_ans, tf_ans) 300 self.assertShapeEqual(np_ans, s [all...] |
matrix_solve_ls_op_test.py | 59 np_ans, _, _, _ = np.linalg.lstsq(matrix, rhs) 60 return np_ans 101 np_ans = _SolveWithNumpy(x, y, l2_regularizer=l2_regularizer) 102 np_r = np.dot(np.conj(a.T), b - np.dot(a, np_ans)) 107 np_ans = np.tile(np_ans, batch_shape + (1, 1)) 120 self.assertEqual(np_ans.shape, tf_ans.get_shape()) 132 self.assertEqual(np_ans.shape, tf_ans_val.shape) 133 self.assertAllClose(np_ans, tf_ans_val, atol=2 * tol, rtol=2 * tol)
|
matrix_inverse_op_test.py | 43 np_ans = np.identity(y.shape[-1]) 47 np_ans = np.tile(np_ans, tiling) 49 self.assertAllClose(np_ans, out, rtol=1e-4, atol=1e-3)
|
reshape_op_test.py | 34 np_ans = x.reshape(y) 38 self.assertShapeEqual(np_ans, tf_ans) 45 self.assertShapeEqual(np_ans, tf_ans)
|
sparse_tensor_dense_matmul_op_test.py | 62 np_ans = x_mat * y_mat 80 self.assertEqual(tf_value_ans.get_shape()[1], np_ans.shape[1]) 81 self.assertEqual(tf_tensor_ans.get_shape()[1], np_ans.shape[1]) 85 self.assertAllClose(np_ans, out, rtol=1e-4, atol=1e-4) 87 self.assertAllClose(np_ans, out, rtol=1e-6, atol=1e-6) 89 self.assertAllClose(np_ans, out, rtol=1e-4, atol=1e-4)
|
matrix_solve_op_test.py | 55 np_ans = np.linalg.solve(a_np, b) 67 self.assertEqual(np_ans.shape, out.shape) 68 self.assertAllClose(np_ans, out, atol=tol, rtol=tol)
|
sparse_matmul_op_test.py | 70 np_ans = np.matrix(np_x) * np.matrix(np_y) 71 self.assertShapeEqual(np_ans, tf_ans) 72 self.assertAllCloseAccordingToType(np_ans, out, rtol=1e-4, atol=1e-4)
|
cwise_ops_test.py | 95 np_ans = np_func(x) 100 np_ans *= 1.1 104 self.assertShapeEqual(np_ans, y) 106 self.assertAllClose(np_ans, tf_cpu, rtol=1e-3, atol=1e-3) 108 self.assertAllClose(np_ans, tf_cpu) 154 np_ans = np_func(x) 159 self.assertAllClose(np_ans, tf_gpu, rtol=1e-3, atol=1e-3) 161 self.assertAllClose(np_ans, tf_gpu) 532 np_ans = np_func(x, y) 551 if np_ans.dtype != np.object [all...] |
slice_op_test.py | 138 np_ans = x[begin:begin + size, :] 139 self.assertAllEqual(tf_ans, np_ans) 248 np_ans = np.zeros(input_shape) 252 np_ans[slices] = grads 254 self.assertAllClose(np_ans, result)
|
split_op_test.py | 202 np_ans = np.split(x, num, dim) 206 self.assertEqual(num, len(np_ans)) 207 self.assertEqual(num, len(np_ans)) 210 self.assertAllEqual(np_ans[i], out[i]) 211 self.assertShapeEqual(np_ans[i], tf_ans[i])
|
/external/tensorflow/tensorflow/python/ops/ |
dequantize_op_test.py | 58 np_ans = ((inputs.astype(np.float32) + half_range) * 60 self.assertAllClose(tf_ans, np_ans, rtol=1e-5, atol=1e-5)
|
/external/tensorflow/tensorflow/contrib/nccl/python/ops/ |
nccl_ops_test.py | 86 np_ans = tensors[0] 88 np_ans = numpy_fn(np_ans, t) 106 self.assertAllClose(t, np_ans)
|