Add numpy fix for MPS on PyTorch 1.12.1
When saving training results with torch.save(), an exception is thrown: "RuntimeError: Can't call numpy() on Tensor that requires grad. Use tensor.detach().numpy() instead." So for MPS, check if Tensor.requires_grad and detach() if necessary.master
parent
685f9631b5
commit
16b4509fa6
Loading…
Reference in New Issue