Home
last modified time | relevance | path

Searched refs:ndarray (Results 1 – 25 of 137) sorted by relevance

123456

/external/python/cpython3/Lib/test/
Dtest_buffer.py29 ndarray = None variable
44 from numpy import ndarray as numpy_array
627 return ndarray(items, shape=shape, strides=strides, format=fmt,
737 if isinstance(nd, ndarray):
764 @unittest.skipUnless(ndarray, 'ndarray object required for this test')
816 if isinstance(result, ndarray) or is_memoryview_format(fmt):
871 expected = ndarray(trans, shape=shape, format=ff,
877 expected = ndarray(flattened, shape=shape, format=ff)
900 y = ndarray(initlst, shape=shape, flags=ro, format=fmt)
920 y = ndarray(initlst, shape=shape, flags=ro|ND_FORTRAN,
[all …]
Dtest_picklebuffer.py78 ndarray = support.import_module("_testbuffer").ndarray
79 arr = ndarray(list(range(12)), shape=(4, 3), format='<i')
91 arr = ndarray(list(range(12)), shape=(3, 4), strides=(4, 12), format='<i')
112 ndarray = support.import_module("_testbuffer").ndarray
113 arr = ndarray(list(range(3)), shape=(3,), format='<h')
117 arr = ndarray(list(range(6)), shape=(2, 3), format='<h')
121 arr = ndarray(list(range(6)), shape=(2, 3), strides=(2, 4),
127 arr = ndarray(456, shape=(), format='<i')
138 ndarray = support.import_module("_testbuffer").ndarray
139 arr = ndarray(list(range(6)), shape=(6,), format='<i')[::2]
[all …]
/external/tensorflow/tensorflow/compiler/xla/python_api/
Dxla_literal.py57 ndarray = _np.array(
61 return numpy_reshaper(ndarray)
64 def _ConvertNumpyArrayToLiteral(ndarray): argument
66 type_record = types.MAP_DTYPE_TO_RECORD[str(ndarray.dtype)]
68 literal.shape.CopyFrom(xla_shape.CreateShapeFromNumpy(ndarray).message)
70 if ndarray.ndim == 0:
72 ndarray.astype(type_record.literal_field_type).item())
75 if ndarray.dtype in {_np.bool_, _np.dtype('bool')}:
76 for element in _np.nditer(ndarray):
80 ndarray_flat = ndarray.ravel(order='A')
Dxla_shape.py103 def _CreateShapeFromNumpy(ndarray): # pylint: disable=invalid-name argument
112 element_type = types.MAP_DTYPE_TO_RECORD[str(ndarray.dtype)].primitive_type
113 dimensions = ndarray.shape
117 if _np.isfortran(ndarray):
120 layout = range(ndarray.ndim)
124 layout = list(reversed(xrange(ndarray.ndim)))
/external/tensorflow/tensorflow/python/framework/
Dfast_tensor_util.pyx10 tensor_proto, np.ndarray[np.uint16_t, ndim=1] nparray):
22 tensor_proto, np.ndarray[np.uint16_t, ndim=1] nparray):
30 tensor_proto, np.ndarray[np.float32_t, ndim=1] nparray):
38 tensor_proto, np.ndarray[np.float64_t, ndim=1] nparray):
46 tensor_proto, np.ndarray[np.int32_t, ndim=1] nparray):
53 tensor_proto, np.ndarray[np.uint32_t, ndim=1] nparray):
60 tensor_proto, np.ndarray[np.int64_t, ndim=1] nparray):
67 tensor_proto, np.ndarray[np.uint64_t, ndim=1] nparray):
74 tensor_proto, np.ndarray[np.uint8_t, ndim=1] nparray):
82 tensor_proto, np.ndarray[np.uint16_t, ndim=1] nparray):
[all …]
Dtensor_spec_test.py189 self.assertEqual(type(spec.minimum), np.ndarray)
190 self.assertEqual(type(spec.maximum), np.ndarray)
213 self.assertIsInstance(spec.minimum, np.ndarray)
214 self.assertIsInstance(spec.maximum, np.ndarray)
/external/tensorflow/tensorflow/python/ops/numpy_ops/
Dnp_interop_test.py99 self.assertIsInstance(dx, np.ndarray)
100 self.assertIsInstance(dy, np.ndarray)
161 self.assertIsInstance(sq, np.ndarray)
177 self.assertIsInstance(sq, onp.ndarray)
222 self.assertIsInstance(values[0], np.ndarray)
223 self.assertIsInstance(values[1], np.ndarray)
224 self.assertIsInstance(values[2], np.ndarray)
247 self.assertIsInstance(result, np.ndarray)
258 self.assertIsInstance(value_from_dataset, np.ndarray)
265 self.assertIsInstance(value_from_dataset, np.ndarray)
[all …]
Dnp_array_ops.py134 if not isinstance(shape, np_arrays.ndarray):
224 if isinstance(a, np_arrays.ndarray) and (
358 if isinstance(a, np_arrays.ndarray) and dtype == a.dtype.as_numpy_dtype:
367 isinstance(t1, np_arrays.ndarray) and dtype == t1.dtype.as_numpy_dtype):
370 isinstance(t2, np_arrays.ndarray) and dtype == t2.dtype.as_numpy_dtype):
744 setattr(np_arrays.ndarray, '__round__', around)
1038 if isinstance(arrays, (np_arrays.ndarray, ops.Tensor)):
1046 a if isinstance(a, np_arrays.ndarray) else a for a in arrays
1056 a if isinstance(a, np_arrays.ndarray) else a for a in arrays
1070 a if isinstance(a, np_arrays.ndarray) else a for a in arrays
[all …]
Dnp_logic_test.py92 self.assertIsInstance(actual, np_arrays.ndarray)
102 return s if not isinstance(s, np_arrays.ndarray) else s.numpy()
Dnp_arrays.py54 ndarray = ops.Tensor variable
Dnp_arrays_test.py58 if not isinstance(out, np_arrays.ndarray):
205 self.assertIsInstance(repacked[0], np_arrays.ndarray)
206 self.assertIsInstance(repacked[1], np_arrays.ndarray)
/external/tensorflow/tensorflow/lite/experimental/quantization_debugger/
Ddebugger.py53 Callable[[np.ndarray], argument
56 str, Callable[[Sequence[np.ndarray], Sequence[np.ndarray]], argument
90 Iterable[Sequence[np.ndarray]]]] = None, argument
230 tensor_data: Sequence[np.ndarray], argument
264 interpreter: tf.lite.Interpreter) -> List[np.ndarray]:
/external/tensorflow/tensorflow/compiler/tests/
Ddynamic_stitch_test.py64 val1 = np.ndarray(shape=(0, 9), dtype=np.int32)
65 val2 = np.ndarray(shape=(2, 0, 9), dtype=np.int32)
67 expected=np.ndarray(
/external/tensorflow/tensorflow/python/tpu/
Ddevice_assignment.py70 def __init__(self, topology: Topology, core_assignment: np.ndarray): argument
123 def core_assignment(self) -> np.ndarray:
180 computation_shape: Optional[np.ndarray] = None, argument
181 computation_stride: Optional[np.ndarray] = None, argument
339 computation_shape: Optional[np.ndarray] = None, argument
340 computation_stride: Optional[np.ndarray] = None, argument
/external/tensorflow/tensorflow/python/kernel_tests/
Dtensor_priority_test.py30 class NumpyArraySubclass(np.ndarray):
68 class NumpyArraySubclass(np.ndarray):
/external/python/pybind11/tests/
Dtest_numpy_vectorize.py248 assert not isinstance(m.vectorized_func(1, 2, 3), np.ndarray)
249 assert not isinstance(m.vectorized_func(np.array(1), 2, 3), np.ndarray)
251 assert isinstance(z, np.ndarray)
254 assert isinstance(z, np.ndarray)
/external/tensorflow/tensorflow/python/distribute/
Dzero_batch_test.py204 self.assertNotAllEqual(np.ndarray([0, 0, 0]), bn.moving_mean.numpy())
205 self.assertNotAllEqual(np.ndarray([1, 1, 1]), bn.moving_variance.numpy())
206 self.assertNotAllEqual(np.ndarray([1, 1, 1]), bn.gamma.numpy())
207 self.assertNotAllEqual(np.ndarray([0, 0, 0]), bn.beta.numpy())
/external/tensorflow/tensorflow/python/compiler/tensorrt/model_tests/
Dmodel_handler.py90 batch_size: Optional[int] = None) -> np.ndarray:
176 output_tensors: Sequence[np.ndarray], argument
237 ) -> Mapping[str, Union[np.ndarray, framework_ops.Tensor]]:
291 ) -> Mapping[str, np.ndarray]:
299 inputs: Optional[Mapping[str, np.ndarray]] = None, argument
424 calibration_inputs: Optional[Mapping[str, np.ndarray]] = None, argument
471 calibration_inputs: Optional[Mapping[str, np.ndarray]] = None, argument
492 inputs: Optional[Mapping[str, np.ndarray]] = None, argument
/external/tensorflow/tensorflow/python/ops/ragged/
Dragged_tensor_value.py43 if not (isinstance(row_splits, (np.ndarray, np.generic)) and
46 if not isinstance(values, (np.ndarray, np.generic, RaggedTensorValue)):
/external/tensorflow/tensorflow/java/src/main/native/
Dtensor_jni.cc190 jobjectArray ndarray = static_cast<jobjectArray>(src); in writeNDArray() local
191 int len = env->GetArrayLength(ndarray); in writeNDArray()
194 jarray row = static_cast<jarray>(env->GetObjectArrayElement(ndarray, i)); in writeNDArray()
209 jobjectArray ndarray = static_cast<jobjectArray>(dst); in readNDArray() local
210 int len = env->GetArrayLength(ndarray); in readNDArray()
213 jarray row = static_cast<jarray>(env->GetObjectArrayElement(ndarray, i)); in readNDArray()
/external/tensorflow/tensorflow/lite/java/src/main/native/
Dtensor_jni.cc220 jobjectArray ndarray = static_cast<jobjectArray>(dst); in ReadMultiDimensionalArray() local
221 int len = env->GetArrayLength(ndarray); in ReadMultiDimensionalArray()
224 jarray row = static_cast<jarray>(env->GetObjectArrayElement(ndarray, i)); in ReadMultiDimensionalArray()
275 jobjectArray ndarray = static_cast<jobjectArray>(src); in WriteMultiDimensionalArray() local
276 int len = env->GetArrayLength(ndarray); in WriteMultiDimensionalArray()
279 jobject row = env->GetObjectArrayElement(ndarray, i); in WriteMultiDimensionalArray()
/external/tensorflow/tensorflow/python/keras/layers/preprocessing/
Dpreprocessing_stage.py57 (dataset_ops.DatasetV2, np.ndarray, ops.EagerTensor)):
177 not isinstance(datum, (np.ndarray, ops.EagerTensor)) for datum in data
Dhashing.py157 if isinstance(inp, (list, tuple, np.ndarray)):
165 tensor_util.is_tf_type(inp) or isinstance(inp, np.ndarray)
/external/tensorflow/tensorflow/python/eager/
Dpywrap_tensor_test.py30 self.assertIsInstance(result, np.ndarray)
/external/tensorflow/tensorflow/python/lib/core/
Dndarray_tensor.h38 Status NdarrayToTensor(TFE_Context* ctx, PyObject* ndarray,

123456