Skip to content

Commit

Permalink
merged
Browse files Browse the repository at this point in the history
  • Loading branch information
josephdviviano committed Feb 16, 2024
1 parent 3cb9914 commit b85f1eb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/gfn/containers/trajectories.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
from gfn.containers.transitions import Transitions


def is_tensor(t) -> bool:
"""Checks whether t is a torch.Tensor instance."""
return isinstance(t, Tensor)


# TODO: remove env from this class?
class Trajectories(Container):
"""Container for complete trajectories (starting in $s_0$ and ending in $s_f$).
Expand Down
4 changes: 1 addition & 3 deletions src/gfn/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,7 @@ def _step(
not_done_states = new_states[~new_sink_states_idx]
not_done_actions = actions[~new_sink_states_idx]

new_not_done_states_tensor = self.maskless_step(
not_done_states, not_done_actions
)
new_not_done_states_tensor = self.step(not_done_states, not_done_actions)

new_states.tensor[~new_sink_states_idx] = new_not_done_states_tensor

Expand Down

0 comments on commit b85f1eb

Please sign in to comment.