docstr: Tests that proper errors are raised.
      
code: def testErrors(self):
      """Tests that proper errors are raised."""
      shape = [2, 3]
      gen = random.Generator.from_seed(1234)
      with self.assertRaisesWithPredicateMatch(
          errors.InvalidArgumentError, r"must have shape \[\], not"
      ):
          gen_stateful_random_ops.stateful_standard_normal_v2(
              gen.state.handle, [0, 0], shape
          )
      with self.assertRaisesWithPredicateMatch(
          errors.InvalidArgumentError, r"must have shape \[\], not"
      ):
          gen_stateful_random_ops.rng_skip(
              gen.state.handle, gen.algorithm, [0, 0]
          )
      with self.assertRaisesWithPredicateMatch(
          TypeError, "EagerTensor of dtype int64"
      ):
          gen_stateful_random_ops.stateful_standard_normal_v2(
              gen.state.handle, 1.1, shape
          )
      with self.assertRaisesWithPredicateMatch(
          errors.InvalidArgumentError, "Unsupported algorithm id"
      ):
          gen_stateful_random_ops.stateful_standard_normal_v2(
              gen.state.handle, 123, shape
          )
      with self.assertRaisesWithPredicateMatch(
          errors.InvalidArgumentError, "Unsupported algorithm id"
      ):
          gen_stateful_random_ops.rng_read_and_skip(
              gen.state.handle, alg=123, delta=10
          )
      var = variables.Variable([0, 0], dtype=dtypes.int32)
      with self.assertRaisesWithPredicateMatch(
          errors.InvalidArgumentError,
          "dtype of RNG state variable must be int64, not",
      ):
          gen_stateful_random_ops.stateful_standard_normal_v2(
              var.handle, random.RNG_ALG_PHILOX, shape
          )
      var = variables.Variable([[0]], dtype=dtypes.int64)
      with self.assertRaisesWithPredicateMatch(
          errors.InvalidArgumentError,
          "RNG state must have one and only one dimension, not",
      ):
          gen_stateful_random_ops.stateful_standard_normal_v2(
              var.handle, random.RNG_ALG_PHILOX, shape
          )
      var = variables.Variable([0], dtype=dtypes.int64)
      with self.assertRaisesWithPredicateMatch(
          errors.InvalidArgumentError,
          "For the Philox algorithm, the size of state must be at least",
      ):
          gen_stateful_random_ops.stateful_standard_normal_v2(
              var.handle, random.RNG_ALG_PHILOX, shape
          )
      with self.assertRaisesWithPredicateMatch(
          ValueError, "minval must be a scalar; got a tensor of shape "
      ):
  
          @def_function.function
          def f():
              gen.uniform(
                  shape=shape,
                  minval=array_ops.zeros(shape, "int32"),
                  maxval=100,
                  dtype="int32",
              )
  
          f()
      with self.assertRaisesWithPredicateMatch(
          ValueError, "maxval must be a scalar; got a tensor of shape "
      ):
  
          @def_function.function
          def f2():
              gen.uniform(
                  shape=shape,
                  minval=0,
                  maxval=array_ops.ones(shape, "int32") * 100,
                  dtype="int32",
              )
  
          f2()
  
imports: import os
  import re
  from absl.testing import parameterized
  import numpy
  from tensorflow.python.checkpoint import checkpoint
  from tensorflow.python.eager import context
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import config
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.kernel_tests.random import util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gen_random_ops
  from tensorflow.python.ops import gen_stateful_random_ops
  from tensorflow.python.ops import logging_ops
  from tensorflow.python.ops import random_ops_util
  from tensorflow.python.ops import stateful_random_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import test
label_desc: Use image node_id 31 for calling the StatefulRandomOpsTest obj's underlying member method code with example usage: obj.testErrors() without return types