Closed DuaneNielsen closed 3 months ago
I think this maybe..
@property
def env_id(self) -> core.EnvId:
if self._size.ndim == 0:
size = int(self._size.item())
else:
size = int(self._size[0].item())
return f"go_{size}x{size}" # type: ignore
Tested the above.. seems to work.
Hi, thank you for reporting a bug! 🙏 We released a new version which should resolve it. Please let me know if you find another bug!
In go.py
I"m new to the code, but it looks like the intent here was to pick the first state on the array if the state is vectorized.
On my system, if the state is vectorized.. this throws a ValueError, not a Type Error.. like below
Traceback (most recent call last): File "/home/duane/PycharmProjects/mctx_bench/.venv/lib/python3.10/site-packages/pgx/go.py", line 56, in env_id size = int(self._size.item()) File "/home/duane/PycharmProjects/mctx_bench/.venv/lib/python3.10/site-packages/jax/_src/numpy/array_methods.py", line 81, in _item return arr.item(*args) ValueError: can only convert an array of size 1 to a Python scalar
Not sure what the fix is.. maybe