code: def _initialize_operations(self):
      
      if isinstance(self._graph, tf.Graph):
        return self._graph.get_operations()
      elif isinstance(self._graph, mtf.Graph):
        return self._graph.operations
      else:
        raise TypeError('Graph is not tf.Graph or mtf.Graph: {}'
                        .format(type(self._graph)))
docs: Initializer for _operations.
  
      Raises:
        TypeError: _graph is not a tf.Graph or mtf.Graph.
  
      Returns:
        a list of (tf.Operation or mtf.Operation)