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

Warning about ValFunction instantiation when using POT with PyTorch #337

Closed
Pseudomanifold opened this issue Jan 18, 2022 · 1 comment
Closed

Comments

@Pseudomanifold
Copy link
Contributor

Describe the bug

With PyTorch 1.10.1+cu102, using OT on a tensor with a gradient, the following warning message is raised:

[....] valfunction should not be instantiated. Methods on autograd functions are all static, so you should
invoke them on the class itself. Instantiating an autograd function will raise an error in a future version
of PyTorch.

To Reproduce

Steps to reproduce the behavior:

  1. Create tensor with gradient
  2. Use POT function that uses ValFunction from backend.
  3. See warning being raised.

Expected behavior

Warning should not be raised

Environment

  • OS: Linux
  • Python version: 3.9.9
  • How was POT installed (source, pip, conda): poetry (pip + virtualenv)

Output of the following code snippet:

import platform; print(platform.platform())
import sys; print("Python", sys.version)
import numpy; print("NumPy", numpy.__version__)
import scipy; print("SciPy", scipy.__version__)
import ot; print("POT", ot.__version__)
Linux-5.16.1-arch1-1-x86_64-with-glibc2.33
Python 3.9.9 (main, Dec 17 2021, 20:04:17) 
[GCC 11.1.0]
NumPy 1.22.1
SciPy 1.7.3
POT 0.8.1.0

Additional context

PR is being prepared to address this issue.

@Pseudomanifold Pseudomanifold changed the title Warning when using POT with PyTorch Warning about ValFunction instantiation when using POT with PyTorch Jan 18, 2022
@rflamary
Copy link
Collaborator

Closed in #338

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants