Example scripts typing fails with `X is not a generic class`
Closed this issue · 3 comments
josephdviviano commented
$ python train_hypergrid.py
Traceback (most recent call last):
File "/home/jdv/code/torchgfn/tutorials/examples/train_hypergrid.py", line 21, in <module>
from gfn.gflownet import (
File "/home/jdv/code/torchgfn/src/gfn/gflownet/__init__.py", line 1, in <module>
from .base import GFlowNet, PFBasedGFlowNet, TrajectoryBasedGFlowNet
File "/home/jdv/code/torchgfn/src/gfn/gflownet/base.py", line 78, in <module>
class TrajectoryBasedGFlowNet(PFBasedGFlowNet[Trajectories]):
File "/home/jdv/miniconda3/envs/torchgfn/lib/python3.10/typing.py", line 312, in inner
return func(*args, **kwds)
File "/home/jdv/miniconda3/envs/torchgfn/lib/python3.10/typing.py", line 1345, in __class_getitem__
_check_generic(cls, params, len(cls.__parameters__))
File "/home/jdv/.local/lib/python3.10/site-packages/typing_extensions.py", line 152, in _check_generic
raise TypeError(f"{cls} is not a generic class")
TypeError: <class 'gfn.gflownet.base.PFBasedGFlowNet
I'm not sure when this was introduced.
josephdviviano commented
@marpaia perhaps we will be able to collaborate on this one
josephdviviano commented
This is fixed in #139