Home
last modified time | relevance | path

Searched refs:ndim (Results 1 – 25 of 148) sorted by relevance

123456

/external/tensorflow/tensorflow/python/keras/engine/
Dinput_spec.py57 ndim=None, argument
63 self.ndim = len(shape)
66 self.ndim = ndim
76 if self.axes and (self.ndim is not None or self.max_ndim is not None):
77 max_dim = (self.ndim if self.ndim else self.max_ndim) - 1
86 ('ndim=' + str(self.ndim)) if self.ndim else '',
96 'ndim': self.ndim,
118 if spec.ndim is None and spec.shape is None:
123 shape = [None] * spec.ndim
160 if (spec.ndim is not None or
[all …]
Dinput_spec_test.py43 spec = input_spec.InputSpec(ndim=5)
47 spec = input_spec.InputSpec(ndim=0)
51 spec = input_spec.InputSpec(ndim=3, axes={1: 3, -1: 2})
/external/python/pybind11/include/pybind11/
Dbuffer_info.h22 ssize_t ndim = 0; // Number of dimensions member
28 buffer_info(void *ptr, ssize_t itemsize, const std::string &format, ssize_t ndim, in buffer_info()
30 : ptr(ptr), itemsize(itemsize), size(1), format(format), ndim(ndim), in buffer_info()
32 if (ndim != (ssize_t) shape.size() || ndim != (ssize_t) strides.size()) in buffer_info()
34 for (size_t i = 0; i < (size_t) ndim; ++i) in buffer_info()
50 : buffer_info(view->buf, view->itemsize, view->format, view->ndim,
51 {view->shape, view->shape + view->ndim}, {view->strides, view->strides + view->ndim}) {
68 ndim = rhs.ndim;
83 … buffer_info(private_ctr_tag, void *ptr, ssize_t itemsize, const std::string &format, ssize_t ndim, in buffer_info()
85 : buffer_info(ptr, itemsize, format, ndim, std::move(shape_in), std::move(strides_in)) { } in buffer_info()
Dnumpy.h391 ssize_t ndim() const { return dims_; }
400 return std::accumulate(shape_, shape_ + ndim(), (ssize_t) 1, std::multiplies<ssize_t>());
560 auto ndim = shape->size();
561 if (ndim != strides->size())
577 api.PyArray_Type_, descr.release().ptr(), (int) ndim, shape->data(), strides->data(),
619 return std::accumulate(shape(), shape() + ndim(), (ssize_t) 1, std::multiplies<ssize_t>());
633 ssize_t ndim() const {
649 if (dim >= ndim())
661 if (dim >= ndim())
698 if ((ssize_t) sizeof...(index) > ndim())
[all …]
/external/python/cpython3/Objects/
Dmemoryobject.c253 (view->suboffsets && view->suboffsets[dest->ndim-1] >= 0)
258 assert(dest->ndim > 0 && src->ndim > 0); in last_dim_is_contiguous()
261 dest->strides[dest->ndim-1] == dest->itemsize && in last_dim_is_contiguous()
262 src->strides[src->ndim-1] == src->itemsize); in last_dim_is_contiguous()
296 if (dest->ndim != src->ndim) in equiv_shape()
299 for (i = 0; i < dest->ndim; i++) { in equiv_shape()
359 copy_rec(const Py_ssize_t *shape, Py_ssize_t ndim, Py_ssize_t itemsize, in copy_rec() argument
366 assert(ndim >= 1); in copy_rec()
368 if (ndim == 1) { in copy_rec()
380 copy_rec(shape+1, ndim-1, itemsize, in copy_rec()
[all …]
/external/tensorflow/tensorflow/python/framework/
Dfast_tensor_util.pyx10 tensor_proto, np.ndarray[np.uint16_t, ndim=1] nparray): argument
22 tensor_proto, np.ndarray[np.uint16_t, ndim=1] nparray): argument
30 tensor_proto, np.ndarray[np.float32_t, ndim=1] nparray): argument
38 tensor_proto, np.ndarray[np.float64_t, ndim=1] nparray): argument
46 tensor_proto, np.ndarray[np.int32_t, ndim=1] nparray): argument
53 tensor_proto, np.ndarray[np.uint32_t, ndim=1] nparray): argument
60 tensor_proto, np.ndarray[np.int64_t, ndim=1] nparray): argument
67 tensor_proto, np.ndarray[np.uint64_t, ndim=1] nparray): argument
74 tensor_proto, np.ndarray[np.uint8_t, ndim=1] nparray): argument
82 tensor_proto, np.ndarray[np.uint16_t, ndim=1] nparray): argument
[all …]
/external/python/cpython3/Modules/
D_testbuffer.c154 base->ndim = 1; in ndbuf_new()
267 if (ndbuf->base.ndim == 0) in init_flags()
473 copy_rec(const Py_ssize_t *shape, Py_ssize_t ndim, Py_ssize_t itemsize, in copy_rec() argument
480 assert(ndim >= 1); in copy_rec()
482 if (ndim == 1) { in copy_rec()
506 copy_rec(shape+1, ndim-1, itemsize, in copy_rec()
520 dest->ndim != src->ndim) in cmp_structure()
523 for (i = 0; i < dest->ndim; i++) { in cmp_structure()
541 assert(dest->ndim > 0); in copy_buffer()
549 if ((dest->suboffsets && dest->suboffsets[dest->ndim-1] >= 0) || in copy_buffer()
[all …]
/external/tensorflow/tensorflow/python/layers/
Dutils.py28 def convert_data_format(data_format, ndim): argument
30 if ndim == 3:
32 elif ndim == 4:
34 elif ndim == 5:
37 raise ValueError('Input rank not supported:', ndim)
39 if ndim == 3:
41 elif ndim == 4:
43 elif ndim == 5:
46 raise ValueError('Input rank not supported:', ndim)
/external/tensorflow/tensorflow/python/keras/utils/
Dconv_utils.py28 def convert_data_format(data_format, ndim): argument
30 if ndim == 3:
32 elif ndim == 4:
34 elif ndim == 5:
37 raise ValueError('Input rank not supported:', ndim)
39 if ndim == 3:
41 elif ndim == 4:
43 elif ndim == 5:
46 raise ValueError('Input rank not supported:', ndim)
228 if not 3 <= kernel.ndim <= 5:
[all …]
/external/python/cpython2/Objects/
Dmemoryobject.c11 if (buf->ndim == 0) in get_shape0()
23 if (src->ndim == 1 && src->shape != NULL) { in dup_buffer()
27 if (src->ndim == 1 && src->strides != NULL) { in dup_buffer()
181 if (view->ndim > PY_SSIZE_T_MAX / sizeof(Py_ssize_t)) { in _indirect_copy_nd()
186 indices = (Py_ssize_t *)PyMem_Malloc(sizeof(Py_ssize_t)*view->ndim); in _indirect_copy_nd()
191 for (k=0; k<view->ndim;k++) { in _indirect_copy_nd()
196 for (k=0; k<view->ndim; k++) { in _indirect_copy_nd()
206 func(view->ndim, indices, view->shape); in _indirect_copy_nd()
297 _strided_copy_nd(dest, view->buf, view->ndim, view->shape, in PyMemoryView_GetContiguous()
366 return _IntTupleFromSsizet(self->view.ndim, self->view.shape); in memory_shape_get()
[all …]
/external/tensorflow/tensorflow/python/keras/
Dactivations_test.py70 x = keras.backend.placeholder(ndim=2)
79 x = keras.backend.placeholder(ndim=1)
91 x = keras.backend.placeholder(ndim=2)
109 x = keras.backend.placeholder(ndim=2)
120 x = keras.backend.placeholder(ndim=2)
136 x = keras.backend.placeholder(ndim=2)
149 x = keras.backend.placeholder(ndim=2)
157 x = keras.backend.placeholder(ndim=2)
169 x = keras.backend.placeholder(ndim=2)
181 x = keras.backend.placeholder(ndim=2)
[all …]
Dactivations.py70 ndim = K.ndim(x)
71 if ndim == 2:
73 elif ndim > 2:
/external/python/cpython3/Lib/test/
Dtest_buffer.py256 def strides_from_shape(ndim, shape, itemsize, layout): argument
259 if ndim == 0:
263 for i in range(ndim-2, -1, -1):
267 for i in range(1, ndim):
313 def getindex(ndim, ind, strides): argument
316 for i in range(ndim):
325 ndim = len(shape)
326 sstrides = strides_from_shape(ndim, shape, 1, 'C')
327 dstrides = strides_from_shape(ndim, shape[::-1], 1, 'C')
330 fr = getindex(ndim, ind, sstrides)
[all …]
/external/tensorflow/tensorflow/python/ops/ragged/
Dragged_factory_ops.py171 if not isinstance(pylist, (list, tuple)) and np.ndim(pylist) == 0:
260 if isinstance(pylist, (list, tuple)) or np.ndim(pylist) != 0:
279 if not isinstance(item, (list, tuple)) and np.ndim(item) == 0:
287 is_nested = isinstance(item, (list, tuple)) or np.ndim(item) != 0
300 isinstance(v, (list, tuple)) or np.ndim(v) != 0 for v in flat_values):
/external/tensorflow/tensorflow/compiler/xla/python/
Ddlpack.cc263 dt.ndim = buffer->on_host_shape().dimensions_size(); in BufferToDLPackManagedTensor()
300 if (dlmt->dl_tensor.ndim < 0) { in DLPackManagedTensorToBuffer()
303 dlmt->dl_tensor.ndim); in DLPackManagedTensorToBuffer()
308 reinterpret_cast<int64*>(dlmt->dl_tensor.shape), dlmt->dl_tensor.ndim); in DLPackManagedTensorToBuffer()
316 dlmt->dl_tensor.ndim); in DLPackManagedTensorToBuffer()
319 minor_to_major.resize(dlmt->dl_tensor.ndim); in DLPackManagedTensorToBuffer()
/external/tensorflow/tensorflow/python/keras/layers/
Dmerge.py125 input_ndims = list(map(K.ndim, inputs))
132 x_ndim = K.ndim(x)
142 x_ndim = K.ndim(x)
165 y_ndim = K.ndim(y)
558 elif K.ndim(mask_i) < K.ndim(input_i):
686 axes = [self.axes % K.ndim(x1), self.axes % K.ndim(x2)]
693 axes.append(self.axes[i] % K.ndim(inputs[i]))
Dlocal.py171 self.input_spec = InputSpec(ndim=3)
256 self.input_spec = InputSpec(ndim=3, axes={1: input_dim})
258 self.input_spec = InputSpec(ndim=3, axes={-1: input_dim})
485 self.input_spec = InputSpec(ndim=4)
578 self.input_spec = InputSpec(ndim=4, axes={1: input_filter})
580 self.input_spec = InputSpec(ndim=4, axes={-1: input_filter})
711 ndims = int(mask.ndim / 2)
773 kernel = make_2d(kernel, split_dim=K.ndim(kernel) // 2)
Dconvolutional.py147 self.input_spec = InputSpec(ndim=self.rank + 2)
174 self.input_spec = InputSpec(ndim=self.rank + 2,
910 self.input_spec = InputSpec(ndim=4, axes={channel_axis: input_dim})
988 data_format=conv_utils.convert_data_format(self.data_format, ndim=4))
1203 self.input_spec = InputSpec(ndim=5, axes={channel_axis: input_dim})
1277 data_format=conv_utils.convert_data_format(self.data_format, ndim=5),
1289 data_format=conv_utils.convert_data_format(self.data_format, ndim=4))
1460 self.input_spec = InputSpec(ndim=self.rank + 2,
1705 data_format=conv_utils.convert_data_format(self.data_format, ndim=4))
1711 data_format=conv_utils.convert_data_format(self.data_format, ndim=4))
[all …]
/external/python/pybind11/tests/
Dtest_numpy_array.cpp118 if (r.ndim() != 2) throw std::domain_error("error: ndim != 2"); in auxiliaries()
123 l.append(r.ndim()); in auxiliaries()
160 sm.def("ndim", [](const arr& a) { return a.ndim(); }); in TEST_SUBMODULE()
161 sm.def("shape", [](const arr& a) { return arr(a.ndim(), a.shape()); }); in TEST_SUBMODULE()
163 sm.def("strides", [](const arr& a) { return arr(a.ndim(), a.strides()); }); in TEST_SUBMODULE()
198 {a.shape(), a.shape() + a.ndim()}, in TEST_SUBMODULE()
199 {a.strides(), a.strides() + a.ndim()}, in TEST_SUBMODULE()
325 if (r.ndim() != 2) throw std::domain_error("error: ndim != 2"); in TEST_SUBMODULE()
333 if (r.ndim() != 3) throw std::domain_error("error: ndim != 3"); in TEST_SUBMODULE()
/external/OpenCL-CTS/test_conformance/gl/
Dtest_images_read_common.cpp297 int ndim = 1; in test_cl_image_read() local
302 ndim = 1; in test_cl_image_read()
310 ndim = 2; in test_cl_image_read()
317 ndim = 3; in test_cl_image_read()
329 local_range = (size_t*)malloc(sizeof(size_t) * ndim); in test_cl_image_read()
333 local_range = (size_t*)malloc(sizeof(size_t) * ndim); in test_cl_image_read()
337 error = clEnqueueNDRangeKernel( queue, kernel, ndim, NULL, global_range, in test_cl_image_read()
/external/tensorflow/tensorflow/python/keras/layers/preprocessing/
Dimage_preprocessing.py73 self.input_spec = InputSpec(ndim=4)
79 self.input_spec = InputSpec(ndim=4, axes={channel_axis: channel_dim})
126 self.input_spec = InputSpec(ndim=4)
132 self.input_spec = InputSpec(ndim=4, axes={channel_axis: channel_dim})
205 self.input_spec = InputSpec(ndim=4)
354 self.input_spec = InputSpec(ndim=4)
460 self.input_spec = InputSpec(ndim=4)
689 self.input_spec = InputSpec(ndim=4)
803 self.input_spec = InputSpec(ndim=4)
935 self.input_spec = InputSpec(ndim=4)
/external/tensorflow/tensorflow/compiler/xla/service/gpu/
Dcusolver_rewriter.cc56 int ndim = a_shape.dimensions_size(); in CreateCholesky() local
57 CHECK_GE(ndim, 2); in CreateCholesky()
58 int64 n = a_shape.dimensions(ndim - 1); in CreateCholesky()
/external/python/cpython3/Doc/c-api/
Dbuffer.rst156 .. c:member:: int ndim
169 An array of :c:type:`Py_ssize_t` of length :c:member:`~Py_buffer.ndim`
171 ``shape[0] * ... * shape[ndim-1] * itemsize`` MUST be equal to
182 An array of :c:type:`Py_ssize_t` of length :c:member:`~Py_buffer.ndim`
194 An array of :c:type:`Py_ssize_t` of length :c:member:`~Py_buffer.ndim`.
235 :c:member:`~Py_buffer.len`, :c:member:`~Py_buffer.itemsize`, :c:member:`~Py_buffer.ndim`.
348 :c:member:`~Py_buffer.ndim`, :c:member:`~Py_buffer.shape` and :c:member:`~Py_buffer.strides`.
350 If ``ndim == 0``, the memory location pointed to by :c:member:`~Py_buffer.buf` is
370 def verify_structure(memlen, itemsize, ndim, shape, strides, offset):
384 if ndim <= 0:
[all …]
/external/tensorflow/tensorflow/compiler/xla/python_api/
Dxla_shape.py120 layout = range(ndarray.ndim)
124 layout = list(reversed(xrange(ndarray.ndim)))
/external/tensorflow/tensorflow/core/api_def/base_api/
Dapi_def_DynamicPartition.pbtxt17 For each index tuple `js` of size `partitions.ndim`, the slice `data[js, ...]`
24 outputs[i].shape = [sum(partitions == i)] + data.shape[partitions.ndim:]

123456