class_docstr: Mock policy takes actions 1 and 2, alternating.
class_docstr_tok: ["Mock","policy","takes","actions","1","and","2",",","alternating","."]
code: def _action(self, time_step, policy_state, seed):
      del seed
  
      # Reset the policy for batch indices that have restarted episode.
      policy_state = tf.compat.v1.where(
          time_step.is_first(), self._initial_policy_state, policy_state
      )
  
      # Take actions 1 and 2 alternating.
      action = tf.cast(tf.math.floormod(policy_state, 2) + 1, tf.int32)
      new_policy_state = tf.cast(
          policy_state
          + tf.constant(1, shape=self._batch_shape, dtype=tf.int32),
          tf.int32,
      )
      policy_info = tf.cast(action * 2, tf.int32)
      return policy_step.PolicyStep(
          action, new_policy_state, policy_info
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from typing import Any
  import numpy
  import tensorflow
  from tf_agents import specs
  from tf_agents.environments import py_environment
  from tf_agents.policies import py_policy
  from tf_agents.policies import tf_policy
  from tf_agents.replay_buffers import tf_uniform_replay_buffer
  from tf_agents.specs import tensor_spec
  from tf_agents.trajectories import policy_step
  from tf_agents.trajectories import time_step
  from tf_agents.trajectories import trajectory
  from tf_agents.utils import common
label_desc: Use image node_id 3 for calling the TFPolicyMock obj's underlying member method code with example usage: obj._action(time_step, policy_state, seed) and returns: policy_step