daily pastebin goal
32%
SHARE
TWEET

Untitled

a guest Aug 10th, 2018 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import torch
  2. import torch.nn as nn
  3.  
  4. class Model(nn.Module):
  5.     def __init__(self):
  6.         super(Model, self).__init__()
  7.         self.linear = nn.Linear(1,1)
  8.  
  9.     def forward(self, x):
  10.         y = self.linear(x)
  11.         return y
  12.  
  13. x = torch.zeros(1)
  14.  
  15. model = Model()
  16.  
  17. trace = torch.jit.trace(x)(model)
  18.  
  19. trace.save('trace.pt')
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top