torch-mlir/test/Dialect/Torch/globalize-object-graph-modu...

14 lines
501 B
MLIR
Raw Normal View History

// RUN: npcomp-opt -torch-globalize-object-graph -split-input-file -verify-diagnostics %s
torch.class_type @parent {
torch.method "module_type_return", @module_type_return
}
func private @module_type_return(%arg0: !torch.nn.Module<"parent">) {
// expected-error @+1 {{unsupported use of a torch.nn.Module. Expected only method calls or attribute get/set}}
basicpy.build_list %arg0 : (!torch.nn.Module<"parent">) -> !basicpy.ListType
return
}
torch.nn_module {} : !torch.nn.Module<"parent">