Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failed to legalize operation 'torch.operator' that was explicitly marked illegal: onnx.Unsqueeze #855

Open
pdhirajkumarprasad opened this issue Sep 27, 2024 · 0 comments

Comments

@pdhirajkumarprasad
Copy link

For the given IR

module {
  func.func @"torch-jit-export"(%arg0: !torch.vtensor<[2],si64>, %arg1: !torch.vtensor<[1],si64> ) -> (!torch.vtensor<[?,1,?],f32>) attributes {torch.onnx_meta.ir_version = 7 : si64, torch.onnx_meta.opset_version = 21 : si64, torch.onnx_meta.producer_name = "pytorch", torch.onnx_meta.producer_version = "1.11.0"} {
    %1 = torch.operator "onnx.ConstantOfShape"(%arg0)  : (!torch.vtensor<[2],si64>) -> !torch.vtensor<[?,?],f32> 
    %2 = torch.operator "onnx.Unsqueeze"(%1, %arg1) : (!torch.vtensor<[?,?],f32>, !torch.vtensor<[1],si64>) -> !torch.vtensor<[?,1,?],f32> 
    return %2 : !torch.vtensor<[?,1,?],f32>
  }
}

getting error as

t1.mlir:4:10: error: failed to legalize operation 'torch.operator' that was explicitly marked illegal

command:

torch-mlir-opt -split-input-file -verify-diagnostics -convert-torch-onnx-to-torch t1.mlir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant