Are you on the latest version of PyTorch (v1.3.0)? You can check with print(torch.__version__). This feature was recently added so if you’re on an older version (e.g. v1.0) it might not show up.
For a simple example like:
@torch.jit.script
def x(e):
return e + 10
print(x.graph)