This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tvm.git


The following commit(s) were added to refs/heads/master by this push:
     new e8bc77c  Fix the shift column for scale_shift_nchw and 
scale_shift_nhwc in C topi (#5679)
e8bc77c is described below

commit e8bc77c0dcd9ed1508b1f9cce41bb3a7359d9fe1
Author: tobe <[email protected]>
AuthorDate: Wed May 27 23:59:02 2020 +0800

    Fix the shift column for scale_shift_nchw and scale_shift_nhwc in C topi 
(#5679)
---
 topi/include/topi/nn/mapping.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/topi/include/topi/nn/mapping.h b/topi/include/topi/nn/mapping.h
index d4a3a47..2bf3314 100644
--- a/topi/include/topi/nn/mapping.h
+++ b/topi/include/topi/nn/mapping.h
@@ -48,7 +48,7 @@ using namespace tvm::te;
 inline Tensor scale_shift_nchw(const Tensor& x, const Tensor& scale, const 
Tensor& shift,
                                std::string name = "ScaleShift", std::string 
tag = kBroadcast) {
   return tvm::te::compute(
-      x->shape, [&](Var b, Var c, Var h, Var w) { return x(b, c, h, w) * 
scale(c) + shift(w); },
+      x->shape, [&](Var b, Var c, Var h, Var w) { return x(b, c, h, w) * 
scale(c) + shift(c); },
       name, tag);
 }
 
@@ -66,7 +66,7 @@ inline Tensor scale_shift_nchw(const Tensor& x, const Tensor& 
scale, const Tenso
 inline Tensor scale_shift_nhwc(const Tensor& x, const Tensor& scale, const 
Tensor& shift,
                                std::string name = "ScaleShift", std::string 
tag = kBroadcast) {
   return tvm::te::compute(
-      x->shape, [&](Var b, Var h, Var w, Var c) { return x(b, h, w, c) * 
scale(c) + shift(w); },
+      x->shape, [&](Var b, Var h, Var w, Var c) { return x(b, h, w, c) * 
scale(c) + shift(c); },
       name, tag);
 }
 

Reply via email to