Torch.fx subgraph

Is there a way to extract all leaf nodes (recursive call_modules) and extract some nodes as subgraphs using torch.fx ?

Something like this in torchscript