Skip to content

Commit 519f160

Browse files
generatedunixname1228101065403401meta-codesync[bot]
authored andcommitted
Fix PYRE_FIXME issue in fbcode/pearl/utils/instantiations/spaces/box_action.py
Differential Revision: D103583444 fbshipit-source-id: 5fdc3aab4fa2d5839b265cb23e854a6a70eba894
1 parent 51fad4e commit 519f160

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

pearl/utils/instantiations/spaces/box_action.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,23 +51,17 @@ def __init__(
5151
seed: Random seed used to initialize the random number generator of the
5252
underlying Gymnasium `Box` space.
5353
"""
54-
# pyre-fixme[9]: low has type `Union[float, Tensor]`; used as `ndarray[Any,
55-
# Any]`.
56-
low = (
57-
# pyrefly: ignore [bad-assignment]
54+
low_np = (
5855
reshape_to_1d_tensor(low).numpy(force=True)
5956
if isinstance(low, Tensor)
6057
else np.array([low])
6158
)
62-
# pyre-fixme[9]: high has type `Union[float, Tensor]`; used as `ndarray[Any,
63-
# Any]`.
64-
high = (
65-
# pyrefly: ignore [bad-assignment]
59+
high_np = (
6660
reshape_to_1d_tensor(high).numpy(force=True)
6761
if isinstance(high, Tensor)
6862
else np.array([high])
6963
)
70-
super().__init__(low=low, high=high, seed=seed)
64+
super().__init__(low=low_np, high=high_np, seed=seed)
7165

7266
@property
7367
def action_dim(self) -> int:

0 commit comments

Comments
 (0)