(storage, device)
| 334 | |
| 335 | |
| 336 | def _to_numpy(storage, device): |
| 337 | import torch |
| 338 | |
| 339 | return ( |
| 340 | np.array(storage) |
| 341 | if device == "cpu" |
| 342 | else torch.as_tensor(storage, device=device).cpu().numpy() |
| 343 | ) |
| 344 | |
| 345 | |
| 346 | @test_utils.only_on_linux |
no test coverage detected