class_docstr: Test cases for stateful random-number generator operators.
class_docstr_tok: ["Test","cases","for","stateful","random-number","generator","operators","."]
docstr: Tests ThreeFry2x32 conforms to known results.
      
docstr_tok: ["Tests","ThreeFry2x32","conforms","to","known","results","."]
code: def testThreefry2x32(self):
      """Tests ThreeFry2x32 conforms to known results."""
      # Based on
      # https://github.com/google/jax/blob/8565a3486adf16beb388b2364c9cd930d7a0d92d/tests/random_test.py#L65-L85
      # which is in turn based on
      # https://github.com/DEShawResearch/Random123-Boost/blob/65e3d874b67aa7b3e02d5ad8306462f52d2079c0/libs/random/test/test_threefry.cpp#L30-L32
  
      with ops.device(xla_device_name()):
          g = random.Generator.from_seed(
              seed=0, alg=random.RNG_ALG_THREEFRY
          )
          self._compareToKnownOutputs(
              g,
              [0x00000000, 0x00000000],
              [0x00000000, 0x00000000],
              [0x6B200159, 0x99BA4EFE],
          )
          self._compareToKnownOutputs(
              g,
              [0xFFFFFFFF, 0xFFFFFFFF],
              [0xFFFFFFFF, 0xFFFFFFFF],
              [0x1CB996FC, 0xBB002BE7],
          )
          self._compareToKnownOutputs(
              g,
              [0x243F6A88, 0x85A308D3],
              [0x13198A2E, 0x03707344],
              [0xC4923A9C, 0x483DF7A0],
          )
  
imports: import itertools
  import os
  from absl.testing import parameterized
  import numpy
  from tensorflow.compiler.tests import xla_test
  from tensorflow.python.client import device_lib
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import config
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors_impl
  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 gen_stateful_random_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 flags
  from tensorflow.python.platform import test
label_desc: Use image node_id 4 for calling the StatefulRandomOpsTest obj's underlying member method code with example usage: obj.testThreefry2x32() without return types