Skip to content

Commit

Permalink
Add comment explaining rank-2 signal check.
Browse files Browse the repository at this point in the history
  • Loading branch information
giacs-epic committed Sep 20, 2024
1 parent 60ea7f4 commit 801e564
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/Conversion/TorchOnnxToTorch/DefaultDomainQtoZ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3566,6 +3566,9 @@ void mlir::torch::onnx_c::populateDefaultDomainQtoZ(
binder.op, "Expected signal type having sizes");
}
auto signalShape = signalTy.getSizes();
// The infrastructure of ONNX and onnxruntime supports a rank-2.
// For reference:
// https://github.com/onnx/onnx/blob/060589cb81dfb081ed912c9e722b15fe1dbc1a14/onnx/defs/math/defs.cc#L3475-L3477
if (signalShape.size() != 2 && signalShape.size() != 3) {
return rewriter.notifyMatchFailure(binder.op,
"signal has invalid shape.");
Expand Down

0 comments on commit 801e564

Please sign in to comment.