docstr: Checks that stateless_random_shuffle outputs a permutation.
docstr_tok: ["Checks","that","stateless_random_shuffle","outputs","a","permutation","."]
code: def testOutputIsPermutation(self):
      """Checks that stateless_random_shuffle outputs a permutation."""
      for dtype in (tf.int32, tf.int64, tf.float32, tf.float64):
          identity_permutation = tf.range(10, dtype=dtype)
          random_shuffle_seed_1 = tff_rnd.stateless_random_shuffle(
              identity_permutation, seed=tf.constant((1, 42), tf.int64)
          )
          random_shuffle_seed_2 = tff_rnd.stateless_random_shuffle(
              identity_permutation, seed=tf.constant((2, 42), tf.int64)
          )
          # Check that the shuffles are of the correct dtype
          for shuffle in (random_shuffle_seed_1, random_shuffle_seed_2):
              np.testing.assert_equal(
                  shuffle.dtype, dtype.as_numpy_dtype
              )
          random_shuffle_seed_1 = self.evaluate(random_shuffle_seed_1)
          random_shuffle_seed_2 = self.evaluate(random_shuffle_seed_2)
          identity_permutation = self.evaluate(identity_permutation)
          # Check that the shuffles are different
          self.assertTrue(
              np.abs(
                  random_shuffle_seed_1 - random_shuffle_seed_2
              ).max()
          )
          # Check that the shuffles are indeed permutations
          for shuffle in (random_shuffle_seed_1, random_shuffle_seed_2):
              self.assertAllEqual(
                  set(shuffle), set(identity_permutation)
              )
  
file_path: tf-quant-finance/tf_quant_finance/math/random_ops/stateless_test.py
imports: import numpy
  import tensorflow.compat.v2
  import tf_quant_finance
  from tensorflow.python.framework import test_util
label_desc: Use image node_id 1 for calling the StatelessRandomOpsTest obj's underlying member method code with example usage: obj.testOutputIsPermutation() without return types