TensorLayerX icon indicating copy to clipboard operation
TensorLayerX copied to clipboard

tensorlayerx.nn.UpSampling2d当data_format="channels_first"和paddle.nn.Upsample输出结果维度不一致

Open zhxiucui opened this issue 2 years ago • 0 comments

New Issue Checklist

Issue Description

[INSERT DESCRIPTION OF THE PROBLEM]

Reproducible Code

  • Which OS are you using ?
  • Please provide a reproducible code of your issue. Without any reproducible code, you will probably not receive any help.

[INSERT CODE HERE]

# ======================================================== #
###### THIS CODE IS AN EXAMPLE, REPLACE WITH YOUR OWN ######
# ======================================================== #
import os
import paddle
os.environ['TL_BACKEND'] = 'paddle'
import tensorlayerx as tlx

tlx_ni = tlx.nn.Input([4, 32, 50, 50], name='input')
tlx_out = tlx.nn.UpSampling2d(scale=(2, 2), data_format="channels_first")(tlx_ni)
print(f"tlx_out.shape={tlx_out.shape}")

pd_ni = paddle.rand([4, 32, 50, 50], dtype="float32")
pd_out = paddle.nn.Upsample(scale_factor=2, data_format="NCHW")(pd_ni)
print(f"pd_out.shape={pd_out.shape}")

# ======================================================== #
###### THIS CODE IS AN EXAMPLE, REPLACE WITH YOUR OWN ######
# ======================================================== #

输出结果 tlx_out.shape=[4, 32, 64, 100] pd_out.shape=[4, 32, 100, 100]

zhxiucui avatar Nov 24 '22 05:11 zhxiucui