You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by ma...@apache.org on 2021/12/27 07:17:43 UTC
[tvm] branch main updated: fix a bug of instance norm. (#9806)
This is an automated email from the ASF dual-hosted git repository.
masahi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git
The following commit(s) were added to refs/heads/main by this push:
new 0f3441a fix a bug of instance norm. (#9806)
0f3441a is described below
commit 0f3441a48b1fc685f782b40d2a4c531a4b3dab98
Author: sahalasa <98...@qq.com>
AuthorDate: Mon Dec 27 15:17:02 2021 +0800
fix a bug of instance norm. (#9806)
---
src/relay/transforms/simplify_inference.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/relay/transforms/simplify_inference.cc b/src/relay/transforms/simplify_inference.cc
index 846bc08..e7eef41 100644
--- a/src/relay/transforms/simplify_inference.cc
+++ b/src/relay/transforms/simplify_inference.cc
@@ -151,7 +151,7 @@ Expr InstanceNormToInferUnpack(const Attrs attrs, Expr data, Expr gamma, Expr be
if (i != axis) reduced_axes.push_back(i);
}
- Expr epsilon = MakeConstantScalar(DataType::Float(32), static_cast<float>(param->epsilon));
+ Expr epsilon = MakeConstantScalar(ttype->dtype, static_cast<float>(param->epsilon));
Expr mean = Mean(data, reduced_axes, true, false);
Expr var = Variance(data, mean, reduced_axes, true, false);
Expr denom = Sqrt(Add(var, epsilon));