(tensor)
| 38 | |
| 39 | |
| 40 | def create_variable(tensor): |
| 41 | # Do cuda() before wrapping with variable |
| 42 | if torch.cuda.is_available(): |
| 43 | return Variable(tensor.cuda()) |
| 44 | else: |
| 45 | return Variable(tensor) |
| 46 | |
| 47 | |
| 48 | # pad sequences and sort the tensor |
no outgoing calls
no test coverage detected