Skip to content
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

[Bugfix][PyTorch] Support use_input_stats in instance_norm #14963

Merged
merged 1 commit into from
May 27, 2023

Conversation

liquanfeng
Copy link
Contributor

Fix #14926 .
The input should be normalized with the provided running mean and running variance instead of computing the mean and variance from the input data when use_input_stats is set to false.

@tvm-bot
Copy link
Collaborator

tvm-bot commented May 26, 2023

Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.

Generated by tvm-bot

@@ -1385,6 +1385,9 @@ def instance_norm(self, inputs, input_types):
data = inputs[0]
data_type = input_types[0]
channels = self.infer_shape(data)
running_mean = inputs[3]

Choose a reason for hiding this comment

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

Is this a most recent api change from pytorch or a long ignored params on our side? The former will need us to think about BC.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The latter I think. The "track_running_stats" has been ignored in the unit test.
By the way, there will be another PR later about BC, also on a similar issue.

@masahi masahi merged commit 5f1421d into apache:main May 27, 2023
@liquanfeng liquanfeng deleted the in branch May 27, 2023 11:13
mei-ye pushed a commit to mei-ye/tvm that referenced this pull request Jun 1, 2023
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.

[Bug] [Relay] attribute track_running_stats of InstanceNorm lead to wrong inference results
4 participants