When nn modules are used in a ScriptModule, they get wrapped in an internal class that only copies the nn module’s buffers, submodules, and parameters. So as a workaround you could do something like self.linear.weight.shape[1] to get the in_features.
Really we should be copying everything though, could you file an issue on GitHub 2 with the same example code you posted here?