(*tensors)
| 352 | |
| 353 | # A loop that copies all tensors to cuda asynchronously |
| 354 | def copy_to_device_nonblocking(*tensors): |
| 355 | result = [] |
| 356 | for tensor in tensors: |
| 357 | result.append(tensor.to("cuda:0", non_blocking=True)) |
| 358 | # We need to synchronize |
| 359 | torch.cuda.synchronize() |
| 360 | return result |
| 361 | |
| 362 | |
| 363 | # Create a list of tensors |
nothing calls this directly
no outgoing calls
no test coverage detected