(x,from_numpy=True,dtype='float32',device='cuda:0')
| 180 | |
| 181 | |
| 182 | def to_tensor(x,from_numpy=True,dtype='float32',device='cuda:0'): |
| 183 | if from_numpy: |
| 184 | x = torch.from_numpy(x) |
| 185 | |
| 186 | if dtype=='float32': |
| 187 | x = x.type(torch.float32) |
| 188 | elif dtype =='long': |
| 189 | x = x.type(torch.long) |
| 190 | x = x.to(device) |
| 191 | return x |
| 192 | |
| 193 | def summary(model,file=sys.stderr): |
| 194 | def repr(model): |
nothing calls this directly
no outgoing calls
no test coverage detected