2021-09-24 11:59:12 +08:00
|
|
|
// RUN: torch-mlir-opt -split-input-file -verify-diagnostics %s -torch-verify-invariants-before-backend-lowering
|
2021-06-26 08:25:09 +08:00
|
|
|
|
|
|
|
// -----
|
|
|
|
|
2022-05-17 03:54:35 +08:00
|
|
|
func.func @unknown_rank(%arg0: !torch.vtensor<[],f32>) {
|
2021-06-26 08:25:09 +08:00
|
|
|
// expected-error@+2 {{unsupported by backend lowering: tensor with unknown rank or dtype}}
|
2022-04-08 05:28:06 +08:00
|
|
|
// expected-note@+1 {{this is likely due to a missing shape transfer function in shape_lib_gen.py}}
|
2021-06-26 08:25:09 +08:00
|
|
|
%0 = torch.aten.mul.Tensor %arg0, %arg0 : !torch.vtensor<[],f32>, !torch.vtensor<[],f32> -> !torch.vtensor<*,f32>
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----
|
|
|
|
|
2022-05-17 03:54:35 +08:00
|
|
|
func.func @unknown_dtype(%arg0: !torch.vtensor<[],f32>) {
|
2021-06-26 08:25:09 +08:00
|
|
|
// expected-error@+2 {{unsupported by backend lowering: tensor with unknown rank or dtype}}
|
2022-04-08 05:28:06 +08:00
|
|
|
// expected-note@+1 {{this is likely due to a missing shape transfer function in shape_lib_gen.py}}
|
2021-06-26 08:25:09 +08:00
|
|
|
%0 = torch.aten.mul.Tensor %arg0, %arg0 : !torch.vtensor<[],f32>, !torch.vtensor<[],f32> -> !torch.vtensor<[],unk>
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----
|
|
|
|
|
2022-05-17 03:54:35 +08:00
|
|
|
func.func @unresolved_operator(%arg0: !torch.vtensor<[],f32>, %arg1: !torch.int) {
|
2021-06-26 08:25:09 +08:00
|
|
|
// expected-error@+2 {{unsupported by backend lowering: `torch.operator` op}}
|
|
|
|
// expected-note@+1 {{this is likely due to a missing op that needs to be generated by torch_ods_gen.py}}
|
|
|
|
torch.operator "aten.mul.Scalar"(%arg0, %arg1) : (!torch.vtensor<[],f32>, !torch.int) -> !torch.vtensor<[],f32>
|
|
|
|
return
|
|
|
|
}
|