Skip to content

Commit b101f1b

Browse files
author
KeDengMS
authored
Nuphar: Fix a bug in weight layout where read may go out of bound (microsoft#2129)
1 parent 5c2803f commit b101f1b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

onnxruntime/core/codegen/passes/weight_layout/weight_layout.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ void WeightLayout::CreateLayoutMarshallingTVMOp(tvm::Array<tvm::Tensor>& inputs,
7878
for (size_t dim = 1; dim < input_coord.size(); ++dim)
7979
in_range = in_range && (input_coord[dim] >= 0) && (input_coord[dim] < placeholder->shape[dim]);
8080

81-
return tvm::ir::Select::make(in_range, placeholder(input_coord), pad_zero_expr);
81+
return tvm::if_then_else(in_range, placeholder(input_coord), pad_zero_expr);
8282
} else {
8383
// scalar
8484
return placeholder(input_coord);

0 commit comments

Comments
 (0)