未验证 提交 4d395203 编写于 作者: X xiaoting 提交者: GitHub

Add alias for upsample (#29983)

* add alias for upsample, test=develop

* add alias for upsample

* fix example
上级 85b2f05a
......@@ -76,6 +76,8 @@ from .layer.common import Embedding #DEFINE_ALIAS
from .layer.common import Linear #DEFINE_ALIAS
from .layer.common import Flatten #DEFINE_ALIAS
from .layer.common import Upsample #DEFINE_ALIAS
from .layer.common import UpsamplingNearest2D #DEFINE_ALIAS
from .layer.common import UpsamplingBilinear2D #DEFINE_ALIAS
from .layer.common import Bilinear #DEFINE_ALIAS
from .layer.common import Dropout #DEFINE_ALIAS
from .layer.common import Dropout2D #DEFINE_ALIAS
......
......@@ -421,7 +421,7 @@ class UpsamplingNearest2D(layers.Layer):
import paddle
import paddle.nn as nn
input_data = paddle.rand(2,3,6,10).astype("float32")
input_data = paddle.rand(shape=(2,3,6,10)).astype("float32")
upsample_out = paddle.nn.UpsamplingNearest2D(size=[12,12])
input = paddle.to_tensor(input_data)
output = upsample_out(x=input)
......@@ -498,7 +498,7 @@ class UpsamplingBilinear2D(layers.Layer):
import paddle
import paddle.nn as nn
input_data = paddle.rand(2,3,6,10).astype("float32")
input_data = paddle.rand(shape=(2,3,6,10)).astype("float32")
upsample_out = paddle.nn.UpsamplingBilinear2D(size=[12,12])
input = paddle.to_tensor(input_data)
output = upsample_out(x=input)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册