class_docstr: ValueDice learner.
class_docstr_tok: ["ValueDice","learner","."]
code: def step(self):
      # Get data from replay (dropping extras if any). Note there is no
      # extra data here because we do not insert any into Reverb.
      # TODO(raveman): Add a support for offline training, where we do not consume
      # data from the replay buffer.
      sample = next(self._iterator_replay)
      replay_transitions = types.Transition(*sample.data)
  
      # Get a batch of Transitions from the demonstration.
      demonstration_transitions = next(self._iterator_demonstrations)
  
      self._state, metrics = self._sgd_step(
          self._state, (replay_transitions, demonstration_transitions)
      )
  
      # Compute elapsed time.
      timestamp = time.time()
      elapsed_time = (
          timestamp - self._timestamp if self._timestamp else 0
      )
      self._timestamp = timestamp
  
      # Increment counts and record the current time
      counts = self._counter.increment(steps=1, walltime=elapsed_time)
  
      # Attempts to write the logs.
      self._logger.write({**metrics, **counts})
  
imports: import functools
  import time
  from typing import Any, Dict, Iterator, List, Mapping, NamedTuple, Optional, Tuple
  import acme
  from acme import types
  from acme.agents.jax.value_dice import networks
  from acme.jax import networks
  from acme.jax import utils
  from acme.utils import counting
  from acme.utils import loggers
  import jax
  import jax.numpy
  import optax
  import reverb
label_desc: Use image node_id 2 for calling the ValueDiceLearner obj's underlying member method code with example usage: obj.step() without return types