docstr: Tests V-trace against ground truth data calculated in python.
docstr_tok: ["Tests","V-trace","against","ground","truth","data","calculated","in","python","."]
code: def testVTrace(self, batch_size):
      """Tests V-trace against ground truth data calculated in python."""
      seq_len = 5
  
      values = {
          # Note that this is only for testing purposes using well-formed inputs.
          # In practice we'd be more careful about taking log() of arbitrary
          # quantities.
          "log_rhos": np.log(
              (_shaped_arange(seq_len, batch_size))
              / batch_size
              / seq_len
              + 1
          ),
          # T, B where B_i: [0.9 / (i+1)] * T
          "discounts": np.array(
              [
                  [0.9 / (b + 1) for b in range(batch_size)]
                  for _ in range(seq_len)
              ]
          ),
          "rewards": _shaped_arange(seq_len, batch_size),
          "values": _shaped_arange(seq_len, batch_size) / batch_size,
          "bootstrap_value": _shaped_arange(batch_size) + 1.0,
          "clip_rho_threshold": 3.7,
          "clip_pg_rho_threshold": 2.2,
      }
  
      output = vtrace_ops.vtrace_from_importance_weights(**values)
  
      with self.test_session() as session:
          output_v = session.run(output)
  
      ground_truth_v = _ground_truth_calculation(**values)
      for a, b in zip(ground_truth_v, output_v):
          self.assertAllClose(a, b)
  
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 VtraceTest obj's underlying member method code with example usage: obj.testVTrace(batch_size) without return types