class_docstr: Tests for `Retrace` ops.
class_docstr_tok: ["Tests","for","`","Retrace","`","ops","."]
docstr: Ensure Retrace notices inputs with the wrong rank.
docstr_tok: ["Ensure","Retrace","notices","inputs","with","the","wrong","rank","."]
code: def testRetraceHatesBadlyRankedInputs(self):
      """Ensure Retrace notices inputs with the wrong rank."""
      # No problems if we create a Retrace using correctly-ranked arguments.
      proper_args = [
          self.lambda_,
          self.qs,
          self.targnet_qs,
          self.actions,
          self.rewards,
          self.pcontinues,
          self.target_policy_probs,
          self.behaviour_policy_probs,
      ]
      retrace_ops.retrace(*proper_args)
  
      # Now make a local copy of the args and try modifying each element to have
      # an inappropriate rank. We should get an error each time.
      for i in xrange(len(proper_args)):
          bad_args = list(proper_args)
          bad_args[i] = [bad_args[i]]
          with self.assertRaises(ValueError):
              retrace_ops.retrace(*bad_args)
  
file_path: trfl/trfl/retrace_ops_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  from six.moves import xrange
  import tensorflow.compat.v1
  from trfl import retrace_ops
label_desc: Use image node_id 8 for calling the RetraceOpsTest obj's underlying member method code with example usage: obj.testRetraceHatesBadlyRankedInputs() without return types