class_docstr: Actor which learns (updates its parameters) when `update` is called.
  
  This combines a base actor and a learner. Whenever `update` is called
  on the wrapping actor the learner will take a step (e.g. one step of gradient
  descent) as long as there is data available for training
  (provided iterator and replay_tables are used to check for that).
  Selecting actions and making observations are handled by the base actor.
  Intended to be used by the `run_experiment` only.
class_docstr_tok: ["Actor","which","learns","(","updates","its","parameters",")","when","`","update","`","is","called",".","This","combines","a","base","actor","and","a","learner",".","Whenever","`","update","`","is","called","on","the","wrapping","actor","the","learner","will","take","a","step","(","e.g",".","one","step","of","gradient","descent",")","as","long","as","there","is","data","available","for","training","(","provided","iterator","and","replay_tables","are","used","to","check","for","that",")",".","Selecting","actions","and","making","observations","are","handled","by","the","base","actor",".","Intended","to","be","used","by","the","`","run_experiment","`","only","."]
docstr: Initializes _LearningActor.
  
  Args:
    actor: Actor to be wrapped.
    learner: Learner on which step() is to be called when there is data.
    iterator: Iterator used by the Learner to fetch training data.
    replay_tables: Collection of tables from which Learner fetches data
      through the iterator.
    sample_sizes: For each table from `replay_tables`, how many elements the
      table should have available for sampling to wait for the `iterator` to
      prefetch a batch of data. Otherwise more experience needs to be
      collected by the actor.
    checkpointer: Checkpointer to save the state on update.
docstr_tok: ["Initializes","_LearningActor",".","Args",":","actor",":","Actor","to","be","wrapped",".","learner",":","Learner","on","which","step","(",")","is","to","be","called","when","there","is","data",".","iterator",":","Iterator","used","by","the","Learner","to","fetch","training","data",".","replay_tables",":","Collection","of","tables","from","which","Learner","fetches","data","through","the","iterator",".","sample_sizes",":","For","each","table","from","`","replay_tables","`",",","how","many","elements","the","table","should","have","available","for","sampling","to","wait","for","the","`","iterator","`","to","prefetch","a","batch","of","data",".","Otherwise","more","experience","needs","to","be","collected","by","the","actor",".","checkpointer",":","Checkpointer","to","save","the","state","on","update","."]
code: def __init__(
      self,
      actor: core.Actor,
      learner: core.Learner,
      iterator: core.PrefetchingIterator,
      replay_tables: Sequence[reverb.Table],
      sample_sizes: Sequence[int],
      checkpointer: Optional[savers.Checkpointer],
  ):
      """Initializes _LearningActor.
  
      Args:
        actor: Actor to be wrapped.
        learner: Learner on which step() is to be called when there is data.
        iterator: Iterator used by the Learner to fetch training data.
        replay_tables: Collection of tables from which Learner fetches data
          through the iterator.
        sample_sizes: For each table from `replay_tables`, how many elements the
          table should have available for sampling to wait for the `iterator` to
          prefetch a batch of data. Otherwise more experience needs to be
          collected by the actor.
        checkpointer: Checkpointer to save the state on update.
      """
      self._actor = actor
      self._learner = learner
      self._iterator = iterator
      self._replay_tables = replay_tables
      self._sample_sizes = sample_sizes
      self._learner_steps = 0
      self._checkpointer = checkpointer
  
imports: import sys
  import time
  from typing import Optional, Sequence, Tuple
  import acme
  from acme import core
  from acme import specs
  from acme import types
  from acme.jax import utils
  from acme.jax.experiments import config
  from acme.tf import savers
  from acme.utils import counting
  import dm_env
  import jax
  import reverb
label_desc: Use image node_id 1 to create a new _LearningActor object from inherited base classes: core with example: obj = _LearningActor(actor, learner, iterator, replay_tables, sample_sizes, checkpointer)