James_Reed:

Python-to-Python transformations


Could you please describe what does it mean?

Python code generation is what makes FX a Python-to-Python (or Module-to-Module) transformation toolkit. For each Graph IR, we can create valid Python code matching the Graph’s semantics. This functionality is wrapped up in GraphModule 1, which is a torch.nn.Module instance that holds a Graph as well as a forward method generated from the Graph.

Why does one need to translate Python to Python? Is IR the same IR that we acquire during jit.trace?