code: def _should_cache():
      """Returns True if a default caching device should be set, otherwise False."""
      if context.executing_eagerly():
          return False
      # Don't set a caching device when running in a loop, since it is possible that
      # train steps could be wrapped in a tf.while_loop. In that scenario caching
      # prevents forward computations in loop iterations from re-reading the
      # updated weights.
      graph = ops.get_default_graph()
      ctxt = (
          graph._get_control_flow_context()
      )  # pylint: disable=protected-access
      in_v1_while_loop = (
          control_flow_util.GetContainingWhileContext(ctxt) is not None
      )
      in_v2_while_loop = control_flow_util_v2.in_while_loop_defun(graph)
      return not in_v1_while_loop and not in_v2_while_loop
  
imports: 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 import tensor
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.framework import tensor_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import array_ops_stack
  from tensorflow.python.ops import cond
  from tensorflow.python.ops import control_flow_assert
  from tensorflow.python.ops import control_flow_util
  from tensorflow.python.ops import control_flow_util_v2
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import rnn_cell_impl
  from tensorflow.python.ops import tensor_array_ops
  from tensorflow.python.ops import variable_scope
  from tensorflow.python.ops import while_loop
  from tensorflow.python.util import deprecation
  from tensorflow.python.util import dispatch
  from tensorflow.python.util import nest
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 5 for calling a global function with example usage: _should_cache() and returns: unknown, False