2021-02-18 03:28:51 +08:00
|
|
|
// RUN: npcomp-opt -torch-globalize-object-graph -split-input-file %s | FileCheck %s
|
|
|
|
|
|
|
|
// Check that linkage names consist of the dotted path from the root.
|
|
|
|
|
2021-02-26 07:54:51 +08:00
|
|
|
// CHECK-LABEL: torch.global_slot @m.float : f64 {
|
2021-06-16 03:42:51 +08:00
|
|
|
// CHECK: %[[INIT:.*]] = torch.constant.float 4.200000e+01
|
2021-02-26 07:54:51 +08:00
|
|
|
// CHECK: torch.global_slot.init %[[INIT]] : f64
|
|
|
|
// CHECK: }
|
2021-02-18 03:28:51 +08:00
|
|
|
|
|
|
|
|
|
|
|
torch.class_type @child {
|
|
|
|
torch.attr "float" : f64
|
|
|
|
}
|
|
|
|
torch.class_type @parent {
|
|
|
|
torch.attr "m" : !torch.nn.Module<"child">
|
|
|
|
}
|
|
|
|
|
2021-06-16 03:42:51 +08:00
|
|
|
%c42 = torch.constant.float 42.0
|
2021-02-18 03:28:51 +08:00
|
|
|
%child = torch.nn_module {
|
|
|
|
torch.slot "float", %c42 : f64
|
|
|
|
} : !torch.nn.Module<"child">
|
|
|
|
%parent = torch.nn_module {
|
|
|
|
torch.slot "m", %child : !torch.nn.Module<"child">
|
|
|
|
} : !torch.nn.Module<"parent">
|