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

Method __str__

python/paddle/base/framework.py:7970–7989  ·  view source on GitHub ↗

Convert a EagerParamBase object to a readable string. Returns(str): A readable string. Examples: .. code-block:: pycon >>> import paddle >>> linear = paddle.nn.Linear(3, 3) >>> print(linear.weight)

(self)

Source from the content-addressed store, hash-verified

7968 self._init_op_creator(self, block)
7969
7970 def __str__(self):
7971 """
7972 Convert a EagerParamBase object to a readable string.
7973
7974 Returns(str): A readable string.
7975
7976 Examples:
7977 .. code-block:: pycon
7978
7979 >>> import paddle
7980 >>> linear = paddle.nn.Linear(3, 3)
7981 >>> print(linear.weight)
7982 >>> # doctest: +SKIP('it will be different')
7983 Parameter containing:
7984 Tensor(shape=[3, 3], dtype=float32, place=Place(cpu), stop_gradient=False,
7985 [[ 0.48948765, 0.05829060, -0.25524026],
7986 [-0.70368278, 0.52986908, -0.68742192],
7987 [-0.54217887, 0.48439729, 0.34082305]])
7988 """
7989 return f"Parameter containing:\n{super().__str__()}"
7990
7991 def __deepcopy__(self, memo):
7992 """

Callers

nothing calls this directly

Calls 1

__str__Method · 0.45

Tested by

no test coverage detected