Skip to content

Commit

Permalink
[onnx] Update DefaultDomainGtoP.cpp gridsampler (#3228)
Browse files Browse the repository at this point in the history
Gridsampler
In onnx the interpolation mode is called 'linear' whereas in pytorch it
is called 'bilinear'. This led to the problem that everything other than
'bilinear' was rejected. It needed to be changed to linear.
  • Loading branch information
afalkenberg1 authored Apr 26, 2024
1 parent ac11ec7 commit cd33d8b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Conversion/TorchOnnxToTorch/DefaultDomainGtoP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,11 @@ void mlir::torch::onnx_c::populateDefaultDomainGtoP(
return rewriter.notifyMatchFailure(binder.op,
"gridShape[3] expected to be 2");
std::string mode;
if (binder.customOpNameStringAttr(mode, "mode", "bilinear"))
if (binder.customOpNameStringAttr(mode, "mode", "linear"))
return rewriter.notifyMatchFailure(binder.op, "mode bind failure");
if (mode != "bilinear")
if (mode != "linear" && mode != "bilinear")
return rewriter.notifyMatchFailure(
binder.op, "currently only mode : bilinear supported");
binder.op, "currently only mode : linear supported");
std::string padding;
if (binder.customOpNameStringAttr(padding, "padding_mode", "zeros"))
return rewriter.notifyMatchFailure(binder.op,
Expand Down

0 comments on commit cd33d8b

Please sign in to comment.