From 498cf749c88fd2f503e33a41f021a368a6fce08f Mon Sep 17 00:00:00 2001 From: Menooker Date: Fri, 17 Apr 2020 16:56:50 +0800 Subject: [PATCH] code style changes --- src/relay/transforms/fold_scale_axis.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/relay/transforms/fold_scale_axis.cc b/src/relay/transforms/fold_scale_axis.cc index 02393d0192bcd..ad3bd778840f8 100644 --- a/src/relay/transforms/fold_scale_axis.cc +++ b/src/relay/transforms/fold_scale_axis.cc @@ -896,12 +896,11 @@ Message Conv2DBackwardPrep(const Call& call, const Array& in_messages) // only handle depthwise or full conv2d. // TODO(tvm-team) handle grouped conv by reshape + bcast bool is_depthwise_conv2d = IsDepthwiseConv2D(call, param, kernel_layout); - if(param->groups == 1 || is_depthwise_conv2d) { + if (param->groups == 1 || is_depthwise_conv2d) { auto ko_small_axis = kernel_layout.IndexOf(LayoutAxis::Get('o')); auto ki_small_axis = kernel_layout.IndexOf(LayoutAxis::Get('i')); - if ( (ko_small_axis < 0 && ki_small_axis < 0 && c_small_axis < 0) || //simple layout - (ko_small_axis >= 0 && ki_small_axis >= 0 && c_small_axis >= 0)) //blocked layout - { + if ( (ko_small_axis < 0 && ki_small_axis < 0 && c_small_axis < 0) || // simple layout + (ko_small_axis >= 0 && ki_small_axis >= 0 && c_small_axis >= 0)) { // blocked layout Array arr{c_big_axis}; if (c_small_axis >= 0) { arr.push_back(c_small_axis); @@ -951,10 +950,10 @@ Expr Conv2DBackwardTransform(const Call& call, } else { auto& wshape = weight->type_as()->shape; Array arr; - for(size_t i=0; i(small_ko_axis) || i == static_cast(big_ko_axis)) { auto node = wshape[i].as(); - if(!node) { + if (!node) { // if the shape is not a constant, use normal transform return transformer->NormalCallTransform(call.operator->()); }