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

Function itemsize

python/paddle/pir/math_op_patch.py:1503–1515  ·  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)

Source from the content-addressed store, hash-verified

1501
1502 @property
1503 def itemsize(self) -> int:
1504 """
1505 Returns the number of bytes allocated on the machine for a single element of the Tensor.
1506
1507 Examples:
1508 .. code-block:: pycon
1509
1510 >>> import paddle
1511 >>> x = paddle.randn((2, 3), dtype=paddle.float64)
1512 >>> x.itemsize
1513 8
1514 """
1515 return self.element_size()
1516
1517 import paddle
1518

Callers

nothing calls this directly

Calls 1

element_sizeMethod · 0.45

Tested by

no test coverage detected