       }
     }
     if(!no_gamma) {
-      gamma_grad[b * nchannel + l] += local_gamma_grad[0];
+      gamma_grad[l] += local_gamma_grad[0];
     }
     if(!no_beta) {
-      beta_grad[b * nchannel + l] += local_beta_grad[0];
+      beta_grad[l] += local_beta_grad[0];
     }
   }
 }

    // Write to destination
    for(int i = 0; i < LOAD_UNROLL; ++i) {
      if(!no_gamma) {
        gamma_grad[b * nchannel + l + i] += local_gamma_grad[i];
      }
      if(!no_beta) {
        beta_grad[b * nchannel + l + i] += local_beta_grad[i];
      }
    }
  }
  for(; l < nchannel; ++l) {
    local_mean[0] = mean_data[l];
    local_std[0] = std_data[l];

                               const std::vector<OpReqType>& req,
                               const std::vector<TBlob>& outputs) {
  const LayerNormParam& param = nnvm::get<LayerNormParam>(attrs.parsed);
  /*
  if (req[0] == kNullOp) return;
  CHECK_NE(req[0], kAddTo);
  int axis = param.axis;
