code: def dependency_of_fetches(fetches, op):
      
      try:
          from tensorflow.python.client.session import _FetchHandler as FetchHandler
          # use the graph of the op, so that this function can be called without being under a default graph
          handler = FetchHandler(op.graph, fetches, {})
          targets = tuple(handler.fetches() + handler.targets())
      except ImportError:
          if isinstance(fetches, list):
              targets = tuple(fetches)
          elif isinstance(fetches, dict):
              raise ValueError("Don't know how to parse dictionary to fetch list! "
                               "This is a bug of tensorpack.")
          else:
              targets = (fetches, )
      return dependency_of_targets(targets, op)
docs: Check that op is in the subgraph induced by the dependencies of fetches.
      fetches may have more general structure.
  
      Args:
          fetches: An argument to `sess.run`. Nested structure will affect performance.
          op (tf.Operation or tf.Tensor):
  
      Returns:
          bool: True if any of `fetches` depend on `op`.