Skip to content

Commit

Permalink
Use default_factory instead of an instance for this dataclass field's…
Browse files Browse the repository at this point in the history
… default value.

PiperOrigin-RevId: 547546481
Change-Id: I21ea27e026908bfd0390e5c772b3473fc46bb23d
  • Loading branch information
yilei authored and Copybara-Service committed Jul 12, 2023
1 parent 36798a0 commit fb87fd5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions acme/agents/jax/mpo/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ class MPOConfig:
discrete_policy: bool = False

# Specification of the type of experience the learner will consume.
experience_type: mpo_types.ExperienceType = mpo_types.FromTransitions(
n_step=5)
experience_type: mpo_types.ExperienceType = dataclasses.field(
default_factory=lambda: mpo_types.FromTransitions(n_step=5)
)
num_stacked_observations: int = 1
# Optional data-augmentation transformation for observations.
observation_transform: Optional[Callable[[types.NestedTensor],
Expand Down

0 comments on commit fb87fd5

Please sign in to comment.