parameters: (self, legacy_init_op=None)
docstring: Add legacy init op to the SavedModel.
  
      Args:
        legacy_init_op: Optional legacy init op to support backward compatibility.
  
      Raises:
        TypeError if legacy init op is not of type `Operation`.
        AssertionError if the graph already contains one or more legacy init ops.
docstring_summary: Add legacy init op to the SavedModel.
docstring_tokens: Add legacy init op to the SavedModel .
function: def _maybe_add_legacy_init_op(self, legacy_init_op=None):
      """Add legacy init op to the SavedModel.
  
      Args:
        legacy_init_op: Optional legacy init op to support backward compatibility.
  
      Raises:
        TypeError if legacy init op is not of type `Operation`.
        AssertionError if the graph already contains one or more legacy init ops.
      """
      if legacy_init_op is not None:
        if not isinstance(legacy_init_op, ops.Operation):
          raise TypeError("legacy_init_op needs to be an Operation: %r" %
                          legacy_init_op)
        if ops.get_collection(constants.LEGACY_INIT_OP_KEY):
          raise AssertionError(
              "graph already contains one or more legacy init ops under the "
              "collection {}.".format(constants.LEGACY_INIT_OP_KEY))
        ops.add_to_collection(constants.LEGACY_INIT_OP_KEY, legacy_init_op)
function_tokens: def _maybe_add_legacy_init_op ( self , legacy_init_op = None ) : if legacy_init_op is not None : if not isinstance ( legacy_init_op , ops . Operation ) : raise TypeError ( "legacy_init_op needs to be an Operation: %r" % legacy_init_op ) if ops . get_collection ( constants . LEGACY_INIT_OP_KEY ) : raise AssertionError ( "graph already contains one or more legacy init ops under the " "collection {}." . format ( constants . LEGACY_INIT_OP_KEY ) ) ops . add_to_collection ( constants . LEGACY_INIT_OP_KEY , legacy_init_op )