Skip to content

Commit

Permalink
Fix numpy.float128 not found error (#270)
Browse files Browse the repository at this point in the history
* Fix numpy.float128 not found error

Fixes #268

* fix error

* Fix typo: if->if not

Co-authored-by: Adam Gleave <[email protected]>
  • Loading branch information
shwang and AdamGleave authored Mar 9, 2021
1 parent 9ddd6fa commit 1c1bf24
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/imitation/data/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ def _rews_validation(rews: np.ndarray, acts: np.ndarray):
"rewards must be 1D array, one entry for each action: "
f"{rews.shape} != ({len(acts)},)"
)
if rews.dtype not in [np.float32, np.float64, np.float128]:
raise ValueError("rewards dtype {self.rews.dtype} not a float")
if not np.issubdtype(rews.dtype, np.floating):
raise ValueError(f"rewards dtype {rews.dtype} not a float")


@dataclasses.dataclass(frozen=True)
Expand Down

0 comments on commit 1c1bf24

Please sign in to comment.