Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an issue with MPS (Metal Performance Shaders) compatibility by adding detach() calls before moving tensors to CPU in the FID score calculation.
Key Changes
- Added
.detach()calls before.cpu()for mu1, mu2, sigma1, and sigma2 tensors to prevent gradient tracking issues when moving from GPU to CPU
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
@goanpeca please post here the error you see without this PR to understand better why we need now to call detach |
|
@vfdev-5 it was a suggestion from copilot on the first PR to add the detach method before the CPU.
Is this something that could apply to mu1, mu2, sigma1, sigma2? |
5190667 to
55f3789
Compare
|
@vfdev-5 the error was something on so that is why we had to add a .numpy() call. For the detach see previous message, it was a suggestion from copilot, but if it does not apply, I can revert it! |
55f3789 to
1d7f83d
Compare
Fix MPS by detaching before moving to cpu and moving to numpy array