Skip to content

Set truncated flag before callback invocation #117

Description

@sidnarayanan

In these lines, we mark a trajectory as truncated after callback.after_transition() is invoked, so the callback cannot tell if this transition is the last of the rollout. We should flip the order:

ldp/ldp/alg/rollout.py

Lines 241 to 252 in 1bc0330

await store_step(step)
# set things up for the next iteration
agent_state = step.next_agent_state
obs = step.next_observation
if step.done:
break
if timestep + 1 == max_steps:
trajectory.steps[-1].truncated = True
break

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions