When the ONNX exporter sees an nn.Module, it uses the TorchScript tracer to graph a graph, then converts that graph to an ONNX graph. The TorchScript compiler (torch.jit.script) should be functionally equivalent, so it sound like this is a bug. Could you file an issue on GitHub 23 so we can track this? Thanks!