Home
last modified time | relevance | path

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

1234

/external/python/cpython3/Lib/test/
Dtest_buffer.py27 ndarray = None variable
42 from numpy import ndarray as numpy_array
620 return ndarray(items, shape=shape, strides=strides, format=fmt,
730 if isinstance(nd, ndarray):
757 @unittest.skipUnless(ndarray, 'ndarray object required for this test')
810 if isinstance(result, ndarray) or is_memoryview_format(fmt):
865 expected = ndarray(trans, shape=shape, format=ff,
871 expected = ndarray(flattened, shape=shape, format=ff)
894 y = ndarray(initlst, shape=shape, flags=ro, format=fmt)
905 y = ndarray(initlst, shape=shape, flags=ro|ND_FORTRAN,
[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.py163 self.assertEqual(type(spec.minimum), np.ndarray)
164 self.assertEqual(type(spec.maximum), np.ndarray)
187 self.assertIsInstance(spec.minimum, np.ndarray)
188 self.assertIsInstance(spec.maximum, np.ndarray)
/external/toolchain-utils/cros_utils/
Dstats.py2255 assert type(limits) in [ListType, TupleType, N.ndarray
2292 assert type(limits) in [ListType, TupleType, N.ndarray
2384 assert type(limits) in [ListType, TupleType, N.ndarray
2456 if type(denom) == N.ndarray and asum(zero) <> 0:
2474 if type(denom) == N.ndarray and asum(zero) <> 0:
3340 if type(a) != N.ndarray:
3395 if type(t) == N.ndarray:
3401 if type(t) == N.ndarray:
3403 if type(probs) == N.ndarray:
3485 if type(t) == N.ndarray:
[all …]
Dpstat.py772 if type(indices) not in [ListType, TupleType, N.ndarray]:
798 if type(keepcols) not in [ListType, TupleType, N.ndarray]:
800 if type(collapsecols) not in [ListType, TupleType, N.ndarray]:
822 if type(keepcols) not in [ListType, TupleType, N.ndarray]:
829 if type(item) not in [ListType, TupleType, N.ndarray]:
883 if type(columnlist) not in [ListType, TupleType, N.ndarray]:
885 if type(valuelist) not in [ListType, TupleType, N.ndarray]:
909 if type(columnlist) not in [ListType, TupleType, N.ndarray]:
911 if type(valuelist) not in [ListType, TupleType, N.ndarray]:
/external/tensorflow/tensorflow/python/ops/ragged/
Dragged_test_util.py40 return a.tolist() if isinstance(a, np.ndarray) else a
41 elif isinstance(a, np.ndarray):
85 elif isinstance(value, np.ndarray):
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/lite/java/src/main/native/
Dtensor_jni.cc190 jobjectArray ndarray = static_cast<jobjectArray>(dst); in ReadMultiDimensionalArray() local
191 int len = env->GetArrayLength(ndarray); in ReadMultiDimensionalArray()
194 jarray row = static_cast<jarray>(env->GetObjectArrayElement(ndarray, i)); in ReadMultiDimensionalArray()
242 jobjectArray ndarray = static_cast<jobjectArray>(src); in WriteMultiDimensionalArray() local
243 int len = env->GetArrayLength(ndarray); in WriteMultiDimensionalArray()
246 jobject row = env->GetObjectArrayElement(ndarray, i); in WriteMultiDimensionalArray()
/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/kernel_tests/
Dtensor_priority_test.py30 class NumpyArraySubclass(np.ndarray):
68 class NumpyArraySubclass(np.ndarray):
/external/tensorflow/tensorflow/contrib/slim/python/slim/data/
Dtest_utils.py33 def _encoded_int64_feature(ndarray): argument
35 value=ndarray.flatten().tolist()))
Dtfexample_decoder_test.py39 def _EncodedFloatFeature(self, ndarray): argument
41 float_list=feature_pb2.FloatList(value=ndarray.flatten().tolist()))
43 def _EncodedInt64Feature(self, ndarray): argument
45 int64_list=feature_pb2.Int64List(value=ndarray.flatten().tolist()))
56 def _BytesFeature(self, ndarray): argument
57 values = ndarray.flatten().tolist()
/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/python/lib/core/
Dndarray_tensor.h37 Status PyArrayToTF_Tensor(PyObject* ndarray, Safe_TF_TensorPtr* out_tensor);
/external/tensorflow/tensorflow/python/kernel_tests/distributions/
Dutil_test.py488 if not isinstance(x, np.ndarray):
549 self.assertIsInstance(rank, np.ndarray)
556 self.assertIsInstance(rank, np.ndarray)
563 self.assertIsInstance(rank, np.ndarray)
594 self.assertIsInstance(shape, np.ndarray)
601 self.assertIsInstance(shape, np.ndarray)
608 self.assertIsInstance(shape, np.ndarray)
639 self.assertIsInstance(value, np.ndarray)
646 self.assertIsInstance(value, np.ndarray)
653 self.assertIsInstance(value, np.ndarray)
/external/tensorflow/tensorflow/python/util/
Dserialization.py47 if isinstance(obj, np.ndarray):
/external/tensorflow/tensorflow/python/keras/engine/
Dtraining_distributed.py65 if isinstance(first_x_value, np.ndarray):
91 if isinstance(first_valx_value, np.ndarray):
146 if isinstance(first_x_value, np.ndarray):
178 if isinstance(first_x_value, np.ndarray):
/external/tensorflow/tensorflow/contrib/checkpoint/python/
Dpython_state.py103 if isinstance(value, (numpy.ndarray, numpy.generic)):
/external/tensorflow/tensorflow/examples/tutorials/word2vec/
Dword2vec_basic.py115 batch = np.ndarray(shape=(batch_size), dtype=np.int32)
116 labels = np.ndarray(shape=(batch_size, 1), dtype=np.int32)
/external/tensorflow/tensorflow/python/keras/utils/
Dio_utils.py100 elif isinstance(key, np.ndarray):
/external/tensorflow/tensorflow/contrib/distributions/python/ops/
Dbatch_reshape.py334 if (isinstance(expected_batch_event_shape, np.ndarray) and
335 isinstance(actual_batch_event_shape, np.ndarray)):
/external/tensorflow/tensorflow/compiler/xla/experimental/xla_sharding/
Dxla_sharding.py81 if not isinstance(tile_assignment, _np.ndarray):
/external/tensorflow/tensorflow/python/debug/cli/
Dtensor_format.py127 elif not isinstance(tensor, np.ndarray):
535 if not isinstance(tensor, np.ndarray) or not np.size(tensor):

1234