def METHOD_NAME():
    class GrandChild(LightningModule):
        def __init__(self):
            super().__init__()
            self.model = torch.nn.Linear(1, 1)
        def forward(self, inputs):
            return self.model(inputs)
    class Child(LightningModule):
        def __init__(self):
            super().__init__()
            self.model = torch.nn.Sequential(GrandChild(), GrandChild())
        def forward(self, inputs):
            return self.model(inputs)
    class Parent(LightningModule):
        def __init__(self):
            super().__init__()
            self.model = Child()
        def forward(self, inputs):
            return self.model(inputs)
    lm = Parent()
    assert not lm._jit_is_scripting
    script = lm.to_torchscript(method="script")
    assert not lm._jit_is_scripting
    assert isinstance(script, torch.jit.RecursiveScriptModule)