Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix onnx.Gather lowering with dynamic shapes (llvm#3675)
Supports the result with dynamic shape and scalar indices like ``` func.func @test_gather_scalar(%arg0: !torch.vtensor<[3,4,5],f32>, %arg1: !torch.vtensor<[], si64>) -> !torch.vtensor<[?,?],f32> attributes {torch.onnx_meta.opset_version = 13 : si64} { %0 = torch.operator "onnx.Gather"(%arg0, %arg1) {torch.onnx.axis = 0 : si64} : (!torch.vtensor<[3,4,5],f32>, !torch.vtensor<[], si64>) -> !torch.vtensor<[?,?],f32> return %0 : !torch.vtensor<[?,?],f32> } ``` `Torch::AtenSqueezeOp` is referring to the result shape, so it will failed on lowering if the result shape is dynamic.
- Loading branch information