Skip to content

Commit d259d60

Browse files
committed
Fix lint
1 parent cd468d0 commit d259d60

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

nnvm/include/nnvm/op_attr_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ using FCorrectLayout = std::function<bool(
224224
* \return success flag.
225225
*/
226226
using FCorrectLayoutEx = std::function<bool(
227-
NodeAttrs& attrs,
227+
const NodeAttrs& attrs,
228228
std::vector<TShape>* ishapes,
229229
std::vector<Layout>* ilayouts,
230230
const std::vector<Layout>* last_ilayouts,

nnvm/src/top/nn/nn.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,12 @@ inline bool BatchNormInferShape(const nnvm::NodeAttrs& attrs,
194194
return true;
195195
}
196196

197-
inline bool BatchNormCorrectLayout(NodeAttrs& attrs,
197+
inline bool BatchNormCorrectLayout(const NodeAttrs& attrs_const,
198198
std::vector<TShape>* ishapes,
199199
std::vector<Layout> *in_layouts,
200200
const std::vector<Layout> *last_in_layouts,
201201
std::vector<Layout> *out_layouts) {
202+
NodeAttrs& attrs = const_cast<NodeAttrs&>(attrs_const);
202203
const BatchNormParam& param = nnvm::get<BatchNormParam>(attrs.parsed);
203204
CHECK_EQ(in_layouts->size(), 5U);
204205
CHECK_EQ(last_in_layouts->size(), 5U);
@@ -593,11 +594,12 @@ inline bool PadInferShape(const nnvm::NodeAttrs& attrs,
593594
return true;
594595
}
595596

596-
inline bool PadCorrectLayout(NodeAttrs& attrs,
597+
inline bool PadCorrectLayout(const NodeAttrs& attrs_const,
597598
std::vector<TShape>* ishapes,
598599
std::vector<Layout>* ilayouts,
599600
const std::vector<Layout>* last_ilayouts,
600601
std::vector<Layout>* olayouts) {
602+
NodeAttrs& attrs = const_cast<NodeAttrs&>(attrs_const);
601603
const PadParam& param = nnvm::get<PadParam>(attrs.parsed);
602604
const auto& last_layout = last_ilayouts->at(0);
603605
Layout layout = ilayouts->at(0);

0 commit comments

Comments
 (0)