From fb87fd53ce7250584dc94c481cba949b857ff255 Mon Sep 17 00:00:00 2001 From: Yilei Yang Date: Wed, 12 Jul 2023 11:06:04 -0700 Subject: [PATCH] Use default_factory instead of an instance for this dataclass field's default value. PiperOrigin-RevId: 547546481 Change-Id: I21ea27e026908bfd0390e5c772b3473fc46bb23d --- acme/agents/jax/mpo/config.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/acme/agents/jax/mpo/config.py b/acme/agents/jax/mpo/config.py index 3e1d70ab31..596cf29b3b 100644 --- a/acme/agents/jax/mpo/config.py +++ b/acme/agents/jax/mpo/config.py @@ -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],