Home
last modified time | relevance | path

Searched refs:itemsize (Results 1 – 25 of 64) sorted by relevance

123

/third_party/python/Modules/
Darraymodule.c34 int itemsize; member
171 if (_new_size <= ((~(size_t)0) / self->ob_descr->itemsize)) in array_resize()
172 PyMem_RESIZE(items, char, (_new_size * self->ob_descr->itemsize)); in array_resize()
593 if (size > PY_SSIZE_T_MAX / descr->itemsize) { in newarrayobject()
596 nbytes = size * descr->itemsize; in newarrayobject()
656 memmove(items + (where+1)*self->ob_descr->itemsize, in ins1()
657 items + where*self->ob_descr->itemsize, in ins1()
658 (n-where)*self->ob_descr->itemsize); in ins1()
834 memcpy(np->ob_item, a->ob_item + ilow * a->ob_descr->itemsize, in array_slice()
835 (ihigh-ilow) * a->ob_descr->itemsize); in array_slice()
[all …]
D_testbuffer.c109 ndbuf_new(Py_ssize_t nitems, Py_ssize_t itemsize, Py_ssize_t offset, int flags) in ndbuf_new() argument
115 len = nitems * itemsize; in ndbuf_new()
116 if (offset % itemsize) { in ndbuf_new()
121 if (offset < 0 || offset+itemsize > len) { in ndbuf_new()
151 base->itemsize = 1; in ndbuf_new()
302 Py_ssize_t itemsize) in pack_from_list() argument
345 offset = PyLong_FromSsize_t(i*itemsize); in pack_from_list()
395 pack_single(char *ptr, PyObject *item, const char *fmt, Py_ssize_t itemsize) in pack_single() argument
416 mview = PyMemoryView_FromMemory(ptr, itemsize, PyBUF_WRITE); in pack_single()
473 copy_rec(const Py_ssize_t *shape, Py_ssize_t ndim, Py_ssize_t itemsize, in copy_rec() argument
[all …]
/third_party/python/Objects/
Dmemoryobject.c228 ((view)->shape[0] == 1 || (view)->strides[0] == (view)->itemsize)
264 dest->strides[dest->ndim-1] == dest->itemsize && in last_dim_is_contiguous()
265 src->strides[src->ndim-1] == src->itemsize); in last_dim_is_contiguous()
284 dest->itemsize != src->itemsize) { in equiv_format()
332 copy_base(const Py_ssize_t *shape, Py_ssize_t itemsize, in copy_base() argument
338 Py_ssize_t size = shape[0] * itemsize; in copy_base()
347 for (i=0, p=mem; i < shape[0]; p+=itemsize, sptr+=sstrides[0], i++) { in copy_base()
349 memcpy(p, xsptr, itemsize); in copy_base()
351 for (i=0, p=mem; i < shape[0]; p+=itemsize, dptr+=dstrides[0], i++) { in copy_base()
353 memcpy(xdptr, p, itemsize); in copy_base()
[all …]
Dpicklebufobject.c171 mv->view.itemsize = 1; in picklebuf_raw()
175 mv->view.strides = &mv->view.itemsize; in picklebuf_raw()
Dabstract.c422 sd = view->itemsize; in _IsFortranContiguous()
449 sd = view->itemsize; in _IsCContiguous()
531 Py_ssize_t itemsize = -1; in PyBuffer_SizeFromFormat() local
535 return itemsize; in PyBuffer_SizeFromFormat()
553 itemsize = PyLong_AsSsize_t(res); in PyBuffer_SizeFromFormat()
554 if (itemsize < 0) { in PyBuffer_SizeFromFormat()
563 return itemsize; in PyBuffer_SizeFromFormat()
606 elements = len / view->itemsize; in PyBuffer_FromContiguous()
609 memcpy(ptr, src, view->itemsize); in PyBuffer_FromContiguous()
610 src += view->itemsize; in PyBuffer_FromContiguous()
[all …]
/third_party/boost/libs/python/src/numpy/
Dndarray.cpp44 int itemsize) in is_c_contiguous() argument
47 int total = itemsize; in is_c_contiguous()
58 int itemsize) in is_f_contiguous() argument
61 int total = itemsize; in is_f_contiguous()
71 int itemsize) in is_aligned() argument
75 if (*i % itemsize) return false; in is_aligned()
120 int itemsize = dt.get_itemsize(); in from_data_impl() local
123 if (is_c_contiguous(shape, strides, itemsize)) flags |= NPY_ARRAY_C_CONTIGUOUS; in from_data_impl()
124 if (is_f_contiguous(shape, strides, itemsize)) flags |= NPY_ARRAY_F_CONTIGUOUS; in from_data_impl()
125 if (is_aligned(strides, itemsize)) flags |= NPY_ARRAY_ALIGNED; in from_data_impl()
/third_party/python/Lib/test/
Dtest_buffer.py264 def strides_from_shape(ndim, shape, itemsize, layout): argument
270 strides = list(shape[1:]) + [itemsize]
274 strides = [itemsize] + list(shape[:-1])
435 def verify_structure(memlen, itemsize, ndim, shape, strides, offset): argument
442 if offset % itemsize:
444 if offset < 0 or offset+itemsize > memlen:
446 if any(v % itemsize for v in strides):
459 return 0 <= offset+imin and offset+imax+itemsize <= memlen
468 memlen, itemsize, ndim, shape, strides, offset = t
478 memlen, itemsize, ndim, shape, strides, offset = t
[all …]
Dtest_memoryview.py186 self.assertEqual(m.itemsize, self.itemsize)
190 self.assertEqual(m.strides, (self.itemsize,))
266 with check: m.itemsize
408 itemsize = 1 variable in BaseBytesMemoryTests
415 itemsize = array.array('i').itemsize variable in BaseArrayMemoryTests
Dtest_picklebuffer.py25 self.assertEqual(m.itemsize, expected.itemsize)
Dtest_array.py19 sizeof_wchar = array.array('u').itemsize
214 self.assertGreaterEqual(a.itemsize, self.minitemsize)
242 if a.itemsize in (1, 2, 4, 8):
245 if a.itemsize==1:
518 if a.itemsize>1:
1121 self.assertEqual(len(a) * a.itemsize, 4)
1127 buffer_size = a.buffer_info()[1] * a.itemsize
1185 self.assertEqual(a.itemsize, sizeof_wchar)
1334 lower = -1 * int(pow(2, a.itemsize * 8 - 1))
1335 upper = int(pow(2, a.itemsize * 8 - 1)) - 1
[all …]
Dtest_ioctl.py41 intsize = buf.itemsize
/third_party/mindspore/mindspore/ccsrc/pybind_api/ir/
Dtensor_py.cc44 MS_LOG(WARNING) << "Unsupported DataType format " << buf.format << ", item size " << buf.itemsize; in GetDataTypeBigFormat()
54 switch (buf.itemsize) { in GetDataType()
68 switch (buf.itemsize) { in GetDataType()
84 switch (buf.itemsize) { in GetDataType()
156 ssize_t itemsize() const override { return buffer_.itemsize; } in itemsize() function in mindspore::tensor::TensorDataNumpy
159 ssize_t nbytes() const override { return buffer_.itemsize * buffer_.size; } in nbytes()
232 return std::make_shared<Tensor>(data_type, shape, buf.ptr, buf.size * buf.itemsize); in MakeTensor()
274 std::vector<ssize_t> strides = GetStrides(shape, tensor.data().itemsize()); in GetPyBufferInfo()
276 …tensor.data_c(), tensor.data().itemsize(), GetPyTypeFormat(tensor.data_type()), tensor.DataDim(), … in GetPyBufferInfo()
290 std::vector<ssize_t> strides = GetStrides(shape, tensor.data().itemsize()); in GetPyTupleStrides()
[all …]
/third_party/mindspore/tests/ut/python/pipeline/parse/
Dtest_properties.py99 return (self.value1.itemsize, self.value2.itemsize, self.value3.itemsize)
/third_party/python/Doc/c-api/
Dbuffer.rst116 ``product(shape) * itemsize``. For contiguous arrays, this is the length
130 .. c:member:: Py_ssize_t itemsize
137 be set to ``NULL``, but :c:member:`~Py_buffer.itemsize` still has
141 ``product(shape) * itemsize == len`` still holds and the consumer
142 can use :c:member:`~Py_buffer.itemsize` to navigate the buffer.
146 :c:member:`~Py_buffer.itemsize` and assume ``itemsize == 1``.
171 ``shape[0] * ... * shape[ndim-1] * itemsize`` MUST be equal to
235 :c:member:`~Py_buffer.len`, :c:member:`~Py_buffer.itemsize`, :c:member:`~Py_buffer.ndim`.
347 The logical structure of NumPy-style arrays is defined by :c:member:`~Py_buffer.itemsize`,
351 interpreted as a scalar of size :c:member:`~Py_buffer.itemsize`. In that case,
[all …]
/third_party/python/Lib/ctypes/test/
Dtest_pep3118.py32 self.assertEqual(v.itemsize, sizeof(itemtp))
46 self.assertEqual(n * v.itemsize, len(v.tobytes()))
62 self.assertEqual(v.itemsize, sizeof(itemtp))
/third_party/libxml2/os400/
Dxmllintcl.c30 #define paramlist(itemsize, itemtype) \ argument
34 char _pad[itemsize]; \
Dxmlcatlgcl.c30 #define paramlist(itemsize, itemtype) \ argument
34 char _pad[itemsize]; \
/third_party/mindspore/tests/ut/python/ir/
Dtest_tensor_py.py76 assert arr.itemsize == b.itemsize
/third_party/python/Lib/multiprocessing/
Dconnection.py192 if m.itemsize > 1:
235 itemsize = m.itemsize
236 bytesize = itemsize * len(m)
247 result.readinto(m[offset // itemsize :
248 (offset + size) // itemsize])
Dreduction.py156 bytes_size = a.itemsize * size
169 if len(cmsg_data) % a.itemsize != 0:
/third_party/gstreamer/gstplugins_bad/ext/opencv/
DMotionCells.cpp80 m_header.itemsize = 0; in MotionCells()
308 m_header.itemsize = in initDataFile()
346 GINT32_FROM_BE (m_header.itemsize) - sizeof (mc_data.timestamp)); in saveMotionCells()
376 GINT32_FROM_BE (m_header.itemsize) - sizeof (mc_data.timestamp), 1, in saveMotionCells()
DMotionCells.h67 gint32 itemsize; member
/third_party/python/Doc/library/
Darray.rst63 through the :attr:`itemsize` attribute.
99 .. attribute:: array.itemsize
114 array.itemsize``. This is occasionally useful when working with low-level (and
/third_party/flatbuffers/python/flatbuffers/
Dbuilder.py457 self.StartVector(x.itemsize, x.size, x.dtype.alignment)
466 l = UOffsetTFlags.py_type(x_lend.itemsize * x_lend.size)
/third_party/mindspore/mindspore/ccsrc/backend/optimizer/graph_kernel/
Dgraph_kernel_helper.cc134 auto itemsize = static_cast<size_t>(tensor->data().itemsize()); in ConvertToScalarTensor() local
135 if (memcpy_s(data_ptr, static_cast<size_t>(itemsize), tensor->data_c(), itemsize) != 0) { in ConvertToScalarTensor()

123