torch-mlir/test/Dialect/Torch/reduce-op-variants-error.mlir

27 lines
1.4 KiB
MLIR

// RUN: torch-mlir-opt -torch-reduce-op-variants -verify-diagnostics -split-input-file %s
// -----
func @convert_to_value_semantic_tensors_list( %list: !torch.list<!torch.tensor>) -> !torch.tensor {
%int1 = torch.constant.int 1
// expected-error@+1 {{failed to legalize operation 'torch.aten.cat' that was explicitly marked illegal}}
%ret = torch.aten.cat %list, %int1 : !torch.list<!torch.tensor>, !torch.int -> !torch.tensor
return %ret : !torch.tensor
}
// -----
func @convert_to_value_semantic_tensors_optional(%tensor_optional: !torch.optional<!torch.tensor>,
%t: !torch.tensor,
%training: !torch.bool,
%cudnn_enable: !torch.bool,
%f : !torch.float) -> !torch.tensor {
// expected-error@+1 {{failed to legalize operation 'torch.aten.batch_norm' that was explicitly marked illegal}}
%ret = torch.aten.batch_norm %t, %tensor_optional, %tensor_optional, %tensor_optional,
%tensor_optional, %training, %f, %f, %cudnn_enable:
!torch.tensor, !torch.optional<!torch.tensor>, !torch.optional<!torch.tensor>,
!torch.optional<!torch.tensor>, !torch.optional<!torch.tensor>,
!torch.bool, !torch.float, !torch.float, !torch.bool -> !torch.tensor
return %ret: !torch.tensor
}