(tensor)
| 15 | |
| 16 | |
| 17 | def cuda_variable(tensor): |
| 18 | # Do cuda() before wrapping with variable |
| 19 | if torch.cuda.is_available(): |
| 20 | return Variable(tensor.cuda()) |
| 21 | else: |
| 22 | return Variable(tensor) |
| 23 | |
| 24 | |
| 25 | # Sting to char tensor |
no outgoing calls
no test coverage detected