Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
ChenDRAG committed Mar 21, 2021
1 parent 8d680fe commit ecff62b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tianshou/policy/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ def map_action(self, act: Union[Batch, np.ndarray]) -> Union[Batch, np.ndarray]:
:return: action in the same form of input "act" but remap to the target action
space.
"""
if isinstance(self.action_space, gym.spaces.Box):
if isinstance(self.action_space, gym.spaces.Box) and \
isinstance(act, np.ndarray):
# currently this action mapping only supports np.ndarray action
if self.action_bound_method == "clip":
act = np.clip(act, -1, 1)
Expand Down

0 comments on commit ecff62b

Please sign in to comment.