Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MRG] Fix barycenter_stabilized with PyTorch and log set to True #474

Merged
merged 2 commits into from
May 8, 2023

Conversation

kachayev
Copy link
Collaborator

@kachayev kachayev commented May 5, 2023

Types of changes

Replace call to np.log with call to a proper backend for the barycenter_stabilized procedure.

Motivation and context / Related issue

Otherwise, it fails with

RuntimeError: Can't call numpy() on Tensor that requires grad. Use tensor.detach().numpy() instead.

when called with PyTorch tensors that are marked with required_grad.

How has this been tested (if it applies)

PR checklist

  • I have read the CONTRIBUTING document.
  • The documentation is up-to-date with the changes I made (check build artifacts).
  • [] All tests passed, and additional code has been covered with new tests.
  • I have added the PR and Issue fix to the RELEASES.md file.

@kachayev kachayev changed the title Fix barycenter_stabilized with PyTorch and log set to True [MRG] Fix barycenter_stabilized with PyTorch and log set to True May 5, 2023
@rflamary rflamary merged commit 03341c6 into PythonOT:master May 8, 2023
@kachayev kachayev deleted the fix-barycenter-torch-log branch May 8, 2023 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants