未验证 提交 609c0321 编写于 作者: Y yoyoIcy 提交者: GitHub

[Doctest]fix No.303, test=docs_preview (#56777)

上级 6d19073a
......@@ -40,12 +40,14 @@ def _npu_identity(x, format=-1):
Examples:
.. code-block:: python
# required: npu
import paddle
>>> # doctest: +REQUIRES(env:NPU)
>>> import paddle
>>> paddle.device.set_device('npu')
x = paddle.ones(shape=[6])
y = paddle.incubate._npu_identity(x, 3) # ACL_FORMAT_NC1HWC0 = 3
# y.shape = [1, 1, 1, 1, 16]
>>> x = paddle.ones(shape=[6])
>>> y = paddle.incubate._npu_identity(x, 3) # ACL_FORMAT_NC1HWC0 = 3
>>> print(y.shape)
[1, 1, 1, 1, 16]
"""
if in_dynamic_mode():
return _C_ops.npu_identity(x, format)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册