-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
I think isinstance( retval, (tuple, list))
is wrong as returned value will be an instance of (array, list) or (dict, list) etc.
In my case, my environment return array and dict info upon reset. Here this code doesn't interpret this as having info and because it is a tuple of array, list and not tuple of tuple,list
tianshou/tianshou/env/venv_wrappers.py
Lines 88 to 93 in 99c99bb
retval = self.venv.reset(id, **kwargs) | |
reset_returns_info = isinstance( | |
retval, (tuple, list) | |
) and len(retval) == 2 and isinstance(retval[1], dict) | |
if reset_returns_info: | |
obs, info = retval |
Suggested edit
reset_returns_info = isinstance( retval[0], np.ndarray) and len(retval) == 2 and isinstance( retval[1], list)
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working