/external/tensorflow/tensorflow/compiler/xla/python/ |
D | numpy_bridge.cc | 70 PrimitiveType NumpyTypeToPrimitiveType(int np_type) { in NumpyTypeToPrimitiveType() argument 71 switch (np_type) { in NumpyTypeToPrimitiveType() 103 LOG(FATAL) << "No XLA primitive type for Numpy type " << np_type; in NumpyTypeToPrimitiveType() 107 bool NumpyTypeIsValid(int np_type) { in NumpyTypeIsValid() argument 108 switch (np_type) { in NumpyTypeIsValid() 223 PyObject* np_type; in XlaShapeFromPyShape() local 224 TF_ASSIGN_OR_RETURN(np_type, call_method("numpy_dtype")); in XlaShapeFromPyShape() 225 if (np_type->ob_type != &PyArrayDescr_Type) { in XlaShapeFromPyShape() 230 if (!NumpyTypeIsValid(NumpyTypenum(np_type))) { in XlaShapeFromPyShape() 236 NumpyTypeToPrimitiveType(NumpyTypenum(np_type)); in XlaShapeFromPyShape() [all …]
|
D | numpy_bridge.h | 53 PrimitiveType NumpyTypeToPrimitiveType(int np_type); 57 bool NumpyTypeIsValid(int np_type); 106 Status CopyNumpyArrayToLiteral(int np_type, PyArrayObject* py_array, 109 Status CopyLiteralToNumpyArray(int np_type, const LiteralSlice& literal,
|
/external/tensorflow/tensorflow/python/kernel_tests/ |
D | matrix_solve_op_test.py | 40 for np_type in [np.float32, np.float64, np.complex64, np.complex128]: 41 if np_type == np.float32 or np_type == np.complex64: 46 if np_type is [np.float32, np.float64]: 47 a = x.real().astype(np_type) 48 b = y.real().astype(np_type) 50 a = x.astype(np_type) 51 b = y.astype(np_type) 61 a_ph = array_ops.placeholder(dtypes.as_dtype(np_type)) 62 b_ph = array_ops.placeholder(dtypes.as_dtype(np_type))
|
D | matrix_square_root_op_test.py | 33 def _verifySquareRoot(self, matrix, np_type): argument 34 matrix = matrix.astype(np_type) 43 for np_type in [np.float32, np.float64]: 44 self._verifySquareRoot(x, np_type) 47 for np_type in [np.complex64, np.complex128]: 48 self._verifySquareRoot(x, np_type)
|
D | matrix_exponential_op_test.py | 52 def _verifyExponential(self, x, np_type): argument 53 inp = x.astype(np_type) 57 np_ans = np.empty(x.shape, dtype=np_type) 60 np_ans = np.zeros(inp.shape, dtype=np_type) 69 for np_type in [np.float32, np.float64]: 70 self._verifyExponential(x, np_type) 73 for np_type in [np.complex64, np.complex128]: 74 self._verifyExponential(x, np_type)
|
D | matrix_inverse_op_test.py | 38 def _verifyInverse(self, x, np_type): argument 40 y = x.astype(np_type) 55 for np_type in [np.float32, np.float64]: 56 self._verifyInverse(x, np_type) 59 for np_type in [np.complex64, np.complex128]: 60 self._verifyInverse(x, np_type)
|
D | matrix_logarithm_op_test.py | 41 def _verifyLogarithm(self, x, np_type): argument 42 inp = x.astype(np_type) 51 for np_type in [np.complex64, np.complex128]: 52 self._verifyLogarithm(x, np_type)
|
D | matrix_triangular_solve_op_test.py | 59 for np_type in dtypes: 60 a = x.astype(np_type) 61 b = y.astype(np_type)
|
D | linalg_ops_test.py | 59 for np_type, atol in [(np.float32, 0.05), (np.float64, 1e-5)]: 64 _RandomPDMatrix(n, self.rng)]).astype(np_type) 67 rhs = self.rng.randn(2, n, k).astype(np_type)
|
D | embedding_ops_test.py | 162 np_type = "f" if dtype == dtypes.float32 else "d" 163 val = (np.random.rand(*shard_shape).astype(np_type)) + 1
|
/external/tensorflow/tensorflow/python/kernel_tests/signal/ |
D | fft_ops_test.py | 164 for np_type in (np.complex64, np.complex128): 167 x = np.zeros((0,) * dims).astype(np_type) 174 for np_type, tol in ((np.complex64, 1e-4), (np.complex128, 1e-8)): 179 (4,) * dims).astype(np_type), rank, rtol=tol, atol=tol) 185 for np_type, tol in ((np.complex64, 1e-4), (np.complex128, 1e-5)): 188 (128,) * dims).astype(np_type), rank, rtol=tol, atol=tol) 203 for np_type, tol in ((np.complex64, 1e-4), (np.complex128, 1e-8)): 208 (4,) * dims).astype(np_type), 214 for np_type, tol in ((np.complex64, 1e-4), (np.complex128, 5e-6)): 223 self._compare(gen((4,) * dims).astype(np_type), rank, [all …]
|
/external/tensorflow/tensorflow/python/eager/ |
D | tensor_test.py | 345 for np_type, dtype in [(np.int32, dtypes.int32), 348 x = ops.convert_to_tensor([np.array(65, dtype=np_type), 349 np.array(16, dtype=np_type)])
|
/external/tensorflow/tensorflow/python/lib/core/ |
D | py_func.cc | 372 const int np_type = PyArray_TYPE(input); in ConvertNdarrayToTensor() local 373 switch (np_type) { in ConvertNdarrayToTensor()
|
/external/tensorflow/tensorflow/contrib/layers/python/layers/ |
D | embedding_ops_test.py | 606 np_type = "f" if dtype == dtypes.float32 else "d" 607 val = (np.random.rand(*shard_shape).astype(np_type)) + 1
|