docstr: Test-runs LoopAWR.
docstr_tok: ["Test-runs","LoopAWR","."]
code: def test_sanity_loopawr(self):
      """Test-runs LoopAWR."""
      task = rl_task.RLTask(
          "CartPole-v0", initial_trajectories=0, max_steps=2
      )
      body = lambda mode: tl.Serial(tl.Dense(64), tl.Relu())
      model_fn = functools.partial(models.PolicyAndValue, body=body)
      trainer = actor_critic.LoopAWR(
          task,
          model_fn,
          batch_size=2,
          network_eval_at=(lambda _: True),
          policy_n_steps_per_epoch=2,
          value_n_steps_per_epoch=2,
          n_trajectories_per_epoch=1,
          n_eval_episodes=1,
      )
      trainer.run(2)
      self.assertEqual(2, trainer.current_epoch)
  
imports: import functools
  from absl.testing import absltest
  from absl.testing import parameterized
  from trax import layers
  from trax import models
  from trax import optimizers
  from trax import test_utils
  from trax.rl import actor_critic
  from trax.rl import advantages
  from trax.rl import task
  from trax.supervised import lr_schedules
label_desc: Use image node_id 5 for calling the ActorCriticTest obj's underlying member method code with example usage: obj.test_sanity_loopawr() without return types