code: def testDeterminismExceptionThrowing(self):
      tensor_shape = (5, 20, 20, 3)
      rand_mat = self._PRNG.random_sample(tensor_shape) * 1000 - 500
      with test_util.deterministic_ops():
          with self.assertRaisesRegex(
              ValueError,
              "requires a non-zero seed to be passed in when "
              "determinism is enabled",
          ):
              nn_ops.fractional_max_pool_v2(rand_mat, [1, 1.5, 1.5, 1])
          nn_ops.fractional_max_pool_v2(
              rand_mat, [1, 1.5, 1.5, 1], seed=1
          )
  
          with self.assertRaisesRegex(
              ValueError, 'requires "seed" and "seed2" to be non-zero'
          ):
              nn_ops.fractional_max_pool(rand_mat, [1, 1.5, 1.5, 1])
          nn_ops.fractional_max_pool(
              rand_mat,
              [1, 1.5, 1.5, 1],
              seed=1,
              seed2=1,
              deterministic=True,
          )
  
imports: import math
  import numpy
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gen_nn_ops
  from tensorflow.python.ops import gradient_checker
  from tensorflow.python.ops import nn_ops
  import tensorflow.python.ops.nn_grad
  from tensorflow.python.platform import test
label_desc: Use image node_id 12 for calling the FractionalMaxPoolTest obj's underlying member method code with example usage: obj.testDeterminismExceptionThrowing() without return types