code: def testSetDynamicDimensionSize(self):
      dynamic_size = 7
  
      # XLA doesn't support this for bfloat16.
      for dtype in set(self.numeric_types).intersection(
          set([np.int32, np.float32, np.float64, np.complex64])
      ):
  
          def xla_set_dynamic_dimension_size_fn(x):
              # Tell XLA to cut the array to size=dynamic_size.
              return gen_xla_ops.xla_set_dynamic_dimension_size(
                  x, dim_index=0, size=dynamic_size
              )
  
          a = np.arange(10, dtype=np.int32).astype(dtype)
          expected = a[:dynamic_size]
  
          self._assertOpOutputMatchesExpected(
              xla_set_dynamic_dimension_size_fn,
              args=(a,),
              expected=expected,
          )
  
imports: import functools
  from absl.testing import parameterized
  import numpy
  from tensorflow.compiler.tests import xla_test
  from tensorflow.compiler.tf2xla.ops import gen_xla_ops
  from tensorflow.compiler.tf2xla.python import xla
  from local_xla.xla import xla_data_pb2
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import function
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import array_ops_stack
  from tensorflow.python.ops import random_ops_util
  from tensorflow.python.platform import googletest
label_desc: Use image node_id 13 for calling the XlaOpsNumericalTest obj's underlying member method code with example usage: obj.testSetDynamicDimensionSize() and returns: gen_xla_ops