code: def assert_casting_closed(
      x,
      target_dtype,
      summarize=None,
      message=None,
      name="assert_casting_closed",
  ):
      """Assert that x is fixed under round-trip casting to `target_dtype`.
  
      Note that even when `target_dtype` is the integer dtype of the same width as
      the dtype of `x`, this is stronger than `assert_integer_form`.  This is
      because any given floating-point format can represent integers outside the
      range of the equally wide integer format.
  
      Args:
        x: Floating-point `Tensor`
        target_dtype: A `tf.dtype` used to cast `x` to.
        summarize: Print this many entries of each tensor.
        message: A string to prefix to the default message.
        name: A name for this operation (optional).
  
      Returns:
        Op raising `InvalidArgumentError` if `cast(x, target_dtype) != x`.
      """
      with tf.name_scope(name):
          x = tf.convert_to_tensor(x, name="x")
          if message is None:
              message = (
                  "Tensor values must be representable as {}.".format(
                      target_dtype
                  )
              )
          return assert_util.assert_equal(
              x,
              tf.cast(tf.cast(x, target_dtype), x.dtype),
              summarize=summarize,
              message=message,
              name=name,
          )
  
imports: import functools
  import hashlib
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import reparameterization
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow.python.util import tf_inspect
label_desc: Use image node_id 14 for calling a global function with example usage: assert_casting_closed(x, target_dtype, summarize, message, name) and returns: assert_util