/external/tensorflow/tensorflow/compiler/xla/python/ |
numpy_bridge.h | 16 // These functions transform Python/Numpy data structures to XLA data 18 // appropriate. Python tuples and Numpy ndarrays translate to XLA 19 // tuples and XLA literals, respectively, and Numpy shape/dtype 31 #include "tensorflow/python/lib/core/numpy.h" 37 namespace numpy { namespace in namespace:xla::swig 39 // Maps XLA primitive types (PRED, S8, F32, ..., and TUPLE) to numpy 45 // Determines whether an integer-encoded Numpy dtype is valid, 50 // (numpy dtype, dimensions). If the XLA shape represents a tuple, 51 // then the numpy dtype is NPY_OBJECT ('O') and `dimensions` is a 69 // Converts an XLA literal to a Python object, either a Numpy ndarra [all...] |
numpy_bridge.cc | 24 namespace numpy { namespace in namespace:xla::swig 55 LOG(FATAL) << "No Numpy type for XLA primitive type " << primitive_type; 88 LOG(FATAL) << "No XLA primitive type for Numpy type " << np_type; 208 return error("Shape attribute np_dtype is not an integer numpy dtype"); 211 return error("Shape attribute np_dtype is not a valid integer numpy dtype"); 400 "Non-tuple or Numpy array encountered in conversion to XLA literal."); 436 "No XLA literal container for Numpy type number: %d", np_type); 472 LOG(FATAL) << "No XLA literal container for Numpy type" << np_type; 513 } // namespace numpy
|
/external/tensorflow/tensorflow/python/ops/ |
resource_variable_ops.py | 629 def numpy(self): member in class:ResourceVariable 632 "numpy() is only available when eager execution is enabled.") 633 return self.read_value().numpy() [all...] |
/external/tensorflow/tensorflow/python/lib/core/ |
bfloat16.cc | 23 #include "tensorflow/python/lib/core/numpy.h" 364 // Numpy support 370 // We must register bfloat16 with a kind other than "f", because numpy 388 // Registered numpy type ID. Global variable populated by the registration code. 391 // Implementations of NumPy array methods. 449 // NumPy casts 451 // Performs a NumPy array cast from type 'From' to 'To'. 462 // Registers a cast between bfloat16 and type 'T'. 'numpy_type' is the NumPy 528 Safe_PyObjectPtr numpy_str = make_safe(MakePyString("numpy")); 532 Safe_PyObjectPtr numpy = make_safe(PyImport_Import(numpy_str.get())) local [all...] |
/external/tensorflow/tensorflow/python/framework/ |
ops.py | 29 import numpy as np 179 """Human readable representation of a tensor's numpy value.""" 181 text = repr(tensor.numpy()) if is_repr else str(tensor.numpy()) 218 objects, whereas `result` is a numpy array that stores a concrete 583 # numpy matrix. 584 # TODO(mrry): Convert this to using numpy's __numpy_ufunc__ 653 A numpy array corresponding to the value of this tensor. 669 def numpy(self): member in class:_EagerTensorBase 670 """Returns a numpy array or a scalar with the same contents as the Tensor [all...] |