code: def _force_data_dependency(first_compute, then_compute):
      """Force all of `then_compute` to depend on all of `first_compute`.
  
      Uses a dummy data dependency, which is useful when running on TPUs because
      XLA ignores control dependencies. Only supports float arguments.
  
      Args:
        first_compute: `list<Tensor>`. These will be made to run before the
          `Tensor`s `then_compute`.
        then_compute: `list<Tensor>`. These will run after all the `Tensor`s in
          `first_compute`.
  
      Returns:
        `list<Tensor>`, same length as `then_compute`.
  
      Raises:
        ValueError: if ranks are unknown or types are not floating.
      """
  
      def _first_element(x):
          if x.get_shape().ndims is None:
              raise ValueError("Rank of Tensor %s must be known" % x)
          ndims = x.get_shape().ndims
          begin = framework_ops.convert_to_tensor(
              [0] * ndims, dtype=dtypes.int32
          )
          size = framework_ops.convert_to_tensor(
              [1] * ndims, dtype=dtypes.int32
          )
          return array_ops.reshape(array_ops.slice(x, begin, size), [])
  
      first_compute_sum = math_ops.add_n(
          [_first_element(x) for x in first_compute if x is not None]
      )
      dtype = first_compute_sum.dtype
      if not dtype.is_floating:
          raise ValueError(
              "_force_data_dependency only supports floating dtypes."
          )
      epsilon = np.finfo(dtype.as_numpy_dtype).tiny
      zero = array_ops.stop_gradient(epsilon * first_compute_sum)
  
      return [
          array_ops.identity(x) + zero if x is not None else None
          for x in then_compute
      ]
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import functools
  import re
  import numpy
  import six
  from six.moves import xrange
  from ..None import contrib_framework
  from tensorflow.python.eager import backprop
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.layers import base
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import control_flow_ops
  from tensorflow.python.ops import control_flow_util
  from tensorflow.python.ops import custom_gradient
  from tensorflow.python.ops import gradients_impl
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import variable_scope
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.util import nest
  from tensorflow.python.util import tf_inspect
label_desc: Use image node_id 14 for calling a global function with example usage: _force_data_dependency(first_compute, then_compute) and returns: unknown, array_ops