未验证 提交 65ac1ef6 编写于 作者: L lilong12 提交者: GitHub

fix docstring for expand, expand_as and tile. (#26529)

* fix docstring, test=document_fix
上级 412eca67
......@@ -910,7 +910,7 @@ def chunk(x, chunks, axis=0, name=None):
paddle.disable_static()
# x is a Tensor which shape is [3, 9, 5]
x_np = np.random.random([3, 9, 5]).astype("int32")
x = paddle.to_variable(x_np)
x = paddle.to_tensor(x_np)
out0, out1, out22 = paddle.chunk(x, chunks=3, axis=1)
# out0.shape [3, 3, 5]
......@@ -1098,12 +1098,6 @@ def expand(x, shape, name=None):
out = paddle.expand(data, shape=[2, 3])
out = out.numpy()
# [[1, 2, 3], [1, 2, 3]]
np_shape = np.array([2, 3]).astype('int32')
shape = paddle.to_tensor(np_shape)
out = paddle.expand(data, shape=shape)
out = out.numpy()
# [[1, 2, 3], [1, 2, 3]]
"""
check_variable_and_dtype(
x, 'x', ['bool', 'float32', 'float64', 'int32', 'int64'], 'expand')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册