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
|
|
|
|
|
|
|
// -----
|
|
|
|
|
|
|
|
func @unknown_rank(%arg0: !torch.vtensor<[],f32>) {
|
|
|
|
// expected-error@+2 {{unsupported by backend lowering: tensor with unknown rank or dtype}}
|
|
|
|
// expected-note@+1 {{this is likely due to a missing case in RefineTypes}}
|
|
|
|
%0 = torch.aten.mul.Tensor %arg0, %arg0 : !torch.vtensor<[],f32>, !torch.vtensor<[],f32> -> !torch.vtensor<*,f32>
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----
|
|
|
|
|
|
|
|
func @unknown_dtype(%arg0: !torch.vtensor<[],f32>) {
|
|
|
|
// expected-error@+2 {{unsupported by backend lowering: tensor with unknown rank or dtype}}
|
|
|
|
// expected-note@+1 {{this is likely due to a missing case in RefineTypes}}
|
|
|
|
%0 = torch.aten.mul.Tensor %arg0, %arg0 : !torch.vtensor<[],f32>, !torch.vtensor<[],f32> -> !torch.vtensor<[],unk>
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----
|
|
|
|
|
|
|
|
func @unresolved_operator(%arg0: !torch.vtensor<[],f32>, %arg1: !torch.int) {
|
|
|
|
// 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
|
|
|
|
}
|