未验证 提交 73f0f2da 编写于 作者: K knamg 提交者: GitHub

delete numpy (#49626)

上级 ac03d353
......@@ -1178,11 +1178,10 @@ class ZeroPad2D(Layer):
import paddle
import paddle.nn as nn
import numpy as np
input_shape = (1, 1, 2, 3)
input_shape = paddle.to_tensor([1, 1, 2, 3])
pad = [1, 0, 1, 2]
data = paddle.arange(np.prod(input_shape), dtype="float32").reshape(input_shape) + 1
data = paddle.arange(paddle.prod(input_shape), dtype="float32").reshape(input_shape) + 1
my_pad = nn.ZeroPad2D(padding=pad)
result = my_pad(data)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册