class_docstr: Implementation of the model-based DreamerV3 RL algorithm described in [1].
class_docstr_tok: ["Implementation","of","the","model-based","DreamerV3","RL","algorithm","described","in","[","1","]","."]
docstr: Sts the algorithm to the provided state
  
  Args:
      state: The state dictionary to restore this `DreamerV3` instance to.
          `state` may have been returned by a call to an `Algorithm`'s
          `__getstate__()` method.
code: def __setstate__(self, state) -> None:
      """Sts the algorithm to the provided state
  
      Args:
          state: The state dictionary to restore this `DreamerV3` instance to.
              `state` may have been returned by a call to an `Algorithm`'s
              `__getstate__()` method.
      """
      # Call the `Algorithm`'s `__setstate__()` method.
      super().__setstate__(state=state)
  
      # Assign the module to the local `EnvRunner` if sharing is enabled.
      # Note, in `Learner.load_state()` the module is first deleted
      # and then a new one is built - therefore the worker has no
      # longer a copy of the learner.
      if self.config.share_module_between_env_runner_and_learner:
          assert id(self.workers.local_worker().module) != id(
              self.learner_group._learner.module[DEFAULT_POLICY_ID]
          )
          self.workers.local_worker().module = (
              self.learner_group._learner.module[DEFAULT_POLICY_ID]
          )
  
imports: import copy
  import gc
  import logging
  import tree
  from typing import Any, Dict, List, Optional, Union
  import gymnasium
  import numpy
  from ray.rllib.algorithms.algorithm import Algorithm
  from ray.rllib.algorithms.algorithm_config import AlgorithmConfig, NotProvided
  from ray.rllib.algorithms.dreamerv3.dreamerv3_catalog import DreamerV3Catalog
  from ray.rllib.algorithms.dreamerv3.utils import do_symlog_obs
  from ray.rllib.algorithms.dreamerv3.utils.env_runner import DreamerV3EnvRunner
  from ray.rllib.algorithms.dreamerv3.utils.summaries import report_predicted_vs_sampled_obs, report_sampling_and_replay_buffer
  from ray.rllib.core.rl_module.rl_module import SingleAgentRLModuleSpec
  from ray.rllib.models.catalog import MODEL_DEFAULTS
  from ray.rllib.policy.sample_batch import DEFAULT_POLICY_ID, SampleBatch
  from ray.rllib.utils import deep_update
  from ray.rllib.utils.annotations import override, PublicAPI
  from ray.rllib.utils.framework import try_import_tf
  from ray.rllib.utils.numpy import one_hot
  from ray.rllib.utils.metrics import ALL_MODULES, GARBAGE_COLLECTION_TIMER, LEARN_ON_BATCH_TIMER, NUM_AGENT_STEPS_SAMPLED, NUM_AGENT_STEPS_TRAINED, NUM_ENV_STEPS_SAMPLED, NUM_ENV_STEPS_TRAINED, NUM_GRAD_UPDATES_LIFETIME, NUM_SYNCH_WORKER_WEIGHTS, NUM_TRAINING_STEP_CALLS_SINCE_LAST_SYNCH_WORKER_WEIGHTS, SAMPLE_TIMER, SYNCH_WORKER_WEIGHTS_TIMER
  from ray.rllib.utils.replay_buffers.episode_replay_buffer import EpisodeReplayBuffer
  from ray.rllib.utils.typing import LearningRateOrSchedule, ResultDict
label_desc: Use image node_id 7 for calling the DreamerV3 obj's underlying member method code with example usage: obj.__setstate__(state) without return types