docstr: Tests log_probs_from_logits_and_actions.
docstr_tok: ["Tests","log_probs_from_logits_and_actions","."]
code: def testLogProbsFromLogitsAndActions(self, batch_size):
      """Tests log_probs_from_logits_and_actions."""
      seq_len = 7
      num_actions = 3
  
      policy_logits = (
          _shaped_arange(seq_len, batch_size, num_actions) + 10
      )
      actions = np.random.randint(
          0, num_actions - 1, size=(seq_len, batch_size), dtype=np.int32
      )
  
      action_log_probs_tensor = (
          vtrace_ops.log_probs_from_logits_and_actions(
              policy_logits, actions
          )
      )
  
      # Ground Truth
      # Using broadcasting to create a mask that indexes action logits
      action_index_mask = actions[..., None] == np.arange(num_actions)
  
      def index_with_mask(array, mask):
          return array[mask].reshape(*array.shape[:-1])
  
      # Note: Normally log(softmax) is not a good idea because it's not
      # numerically stable. However, in this test we have well-behaved values.
      ground_truth_v = index_with_mask(
          np.log(_softmax(policy_logits)), action_index_mask
      )
  
      with self.test_session() as session:
          self.assertAllClose(
              ground_truth_v, session.run(action_log_probs_tensor)
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v1
  from trfl import vtrace_ops
label_desc: Use image node_id 1 for calling the LogProbsFromLogitsAndActionsTest obj's underlying member method code with example usage: obj.testLogProbsFromLogitsAndActions(batch_size) and returns: array