Skip to content

Commit

Permalink
fix a minor error in the Trajectory.__repr__
Browse files Browse the repository at this point in the history
  • Loading branch information
hyeok9855 committed Nov 26, 2024
1 parent 6f132a8 commit 8481673
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gfn/containers/trajectories.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,15 @@ def __repr__(self) -> str:
for traj in states[:10]:
one_traj_repr = []
for step in traj:
one_traj_repr.append(str(step.numpy()))
one_traj_repr.append(str(step.cpu().numpy()))
if step.equal(self.env.s0 if self.is_backward else self.env.sf):
break
trajectories_representation += "-> ".join(one_traj_repr) + "\n"
return (
f"Trajectories(n_trajectories={self.n_trajectories}, max_length={self.max_length}, First 10 trajectories:"
+ f"states=\n{trajectories_representation}"
# + f"actions=\n{self.actions.tensor.squeeze().transpose(0, 1)[:10].numpy()}, "
+ f"when_is_done={self.when_is_done[:10].numpy()})"
+ f"when_is_done={self.when_is_done[:10].cpu().numpy()})"
)

@property
Expand Down

0 comments on commit 8481673

Please sign in to comment.