MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / itemsize

Function itemsize

python/paddle/base/dygraph/math_op_patch.py:588–600  ·  view source on GitHub ↗

Returns the number of bytes allocated on the machine for a single element of the Tensor. Examples: .. code-block:: pycon >>> import paddle >>> x = paddle.randn((2, 3), dtype=paddle.float64) >>> x.itemsize

(self: Tensor)

Source from the content-addressed store, hash-verified

586
587 @property
588 def itemsize(self: Tensor) -> int:
589 """
590 Returns the number of bytes allocated on the machine for a single element of the Tensor.
591
592 Examples:
593 .. code-block:: pycon
594
595 >>> import paddle
596 >>> x = paddle.randn((2, 3), dtype=paddle.float64)
597 >>> x.itemsize
598 8
599 """
600 return self.element_size()
601
602 def _reduce_ex_(self: Tensor, proto):
603 data_numpy = self.numpy()

Callers

nothing calls this directly

Calls 1

element_sizeMethod · 0.45

Tested by

no test coverage detected