Skip to content

[NPU][MLU] fix nearest interpolate unit test bug #716

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 25, 2023

Conversation

BeingGod
Copy link
Contributor

No description provided.

@BeingGod
Copy link
Contributor Author

可以帮忙review一下吗?

@@ -326,6 +326,8 @@ def setUp(self):

if self.scale_by_1Dtensor:
self.inputs["Scale"] = np.array([self.scale]).astype("float32")
out_h = int(self.input_shape[2] * self.scale)
out_w = int(self.input_shape[3] * self.scale)
elif self.scale:
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个不需要哈,347行已经将self.out_size赋值给self.inputs["OutSize"]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

未加上这一行,out_hout_w将没有赋值,在执行365行时,会报UnboundLocalError: local variable 'out_h' referenced before assignment的错误。

Copy link
Collaborator

Choose a reason for hiding this comment

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

好的

@YanhuiDua YanhuiDua changed the title fix(ut): fix nearest interpolate unit test bug [NPU][MLU] fix nearest interpolate unit test bug Jul 25, 2023
@YanhuiDua YanhuiDua merged commit 44a9a80 into PaddlePaddle:develop Jul 25, 2023
@BeingGod BeingGod deleted the fix_nearest_interp_unittest branch July 26, 2023 03:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants