Skip to content

Instantly share code, notes, and snippets.

@jamesr66a
Created November 8, 2018 00:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamesr66a/24c2a2af171907b02d13c4ae333774fe to your computer and use it in GitHub Desktop.
Save jamesr66a/24c2a2af171907b02d13c4ae333774fe to your computer and use it in GitHub Desktop.
import torch
def foo(x):
return x.new_tensor([3]).cpu()
traced = torch.jit.trace(foo, (torch.LongTensor([3, 4, 5])))
print(traced.graph)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment