code: def maybe_cast(t, perform_cast):
      if perform_cast:
          return TensorCastHelper(t)
      return t
  
imports: import timeit
  from absl.testing import parameterized
  from tensorflow.python.eager import backprop
  from tensorflow.python.eager import context
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework.experimental import _unified_api
  from tensorflow.python.framework.experimental import context_stack
  from tensorflow.python.framework.experimental import def_function
  from tensorflow.python.framework.experimental import math_ops
  from tensorflow.python.framework.experimental import nn_ops
  from tensorflow.python.framework.experimental import tape
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import nn_grad
  from tensorflow.python.ops import nn_ops
  from tensorflow.python.ops import random_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 2 for calling a global function with example usage: maybe_cast(t, perform_cast) and returns: t, TensorCastHelper