support 0d tensor for interpolate by tink2123 · Pull Request #49929 · PaddlePaddle/Paddle

@tink2123

PR types

New features

PR changes

Ops

Describe

  • support 0d tensor for intepolate att "scale" "scale_factor"
  • add unittest for test_zero_dim_tensor and test_interpolate_op

@tink2123

@paddle-bot

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@tink2123

@tink2123

zhwesky2010

@tink2123

zhwesky2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM


if (scale_tensor_dim.size() == 1) {
PADDLE_ENFORCE_EQ(
scale_tensor_dim[0] == 2 || scale_tensor_dim[0] == 1,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

什么情况下scale的shape会是[2]呀

pangengzheng pushed a commit to pangengzheng/Paddle that referenced this pull request

Feb 2, 2023
* support 0d tensor for interpolate

* support 0d tensor for interpolate

* add xpu unittest for interp

* update unittest for interpolate

* fix coverage

* fix code style

* fix for coverage

* fix coverage