parameters: (self,
              names_to_variables,
              reshape=False,
              sharded=False,
              max_to_keep=5,
              keep_checkpoint_every_n_hours=10000.0,
              name=None,
              restore_sequentially=False,
              filename="model")
return_statement: return saver_pb2.SaverDef(
          filename_tensor_name=filename_tensor.name,
          save_tensor_name=save_tensor.name,
          restore_op_name=restore_op.name,
          max_to_keep=max_to_keep,
          keep_checkpoint_every_n_hours=keep_checkpoint_every_n_hours,
          sharded=sharded)
docstring: Adds save/restore nodes to the graph and creates a SaverDef proto.
  
      Args:
        names_to_variables: A dictionary mapping name to a Variable.
          Each name will be associated with the
          corresponding variable in the checkpoint.
        reshape: If True, allow restoring parameters from a checkpoint
          that where the parameters have a different shape.  This is
          only needed when you try to restore from a Dist-Belief checkpoint,
          and only some times.
        sharded: If True, shard the checkpoints, one per device that has
          Variable nodes.
        max_to_keep: Maximum number of checkpoints to keep.  As new checkpoints
          are created, old ones are deleted.  If None or 0, no checkpoints are
          deleted from the filesystem but only the last one is kept in the
          `checkpoint` file.  Presently the number is only roughly enforced.  For
          example in case of restarts more than max_to_keep checkpoints may be
          kept.
        keep_checkpoint_every_n_hours: How often checkpoints should be kept.
          Defaults to 10,000 hours.
        name: String.  Optional name to use as a prefix when adding operations.
        restore_sequentially: A Bool, which if true, causes restore of different
          variables to happen sequentially within each device.
        filename: If known at graph construction time, filename used for variable
          loading/saving.
  
      Returns:
        A SaverDef proto.
  
      Raises:
        TypeError: If 'names_to_variables' is not a dictionary mapping string
          keys to variable Tensors.
        ValueError: If any of the keys or values in 'names_to_variables' is not
          unique.
docstring_summary: Adds save/restore nodes to the graph and creates a SaverDef proto.
docstring_tokens: Adds save / restore nodes to the graph and creates a SaverDef proto .
function: def build(self,
              names_to_variables,
              reshape=False,
              sharded=False,
              max_to_keep=5,
              keep_checkpoint_every_n_hours=10000.0,
              name=None,
              restore_sequentially=False,
              filename="model"):
      """Adds save/restore nodes to the graph and creates a SaverDef proto.
  
      Args:
        names_to_variables: A dictionary mapping name to a Variable.
          Each name will be associated with the
          corresponding variable in the checkpoint.
        reshape: If True, allow restoring parameters from a checkpoint
          that where the parameters have a different shape.  This is
          only needed when you try to restore from a Dist-Belief checkpoint,
          and only some times.
        sharded: If True, shard the checkpoints, one per device that has
          Variable nodes.
        max_to_keep: Maximum number of checkpoints to keep.  As new checkpoints
          are created, old ones are deleted.  If None or 0, no checkpoints are
          deleted from the filesystem but only the last one is kept in the
          `checkpoint` file.  Presently the number is only roughly enforced.  For
          example in case of restarts more than max_to_keep checkpoints may be
          kept.
        keep_checkpoint_every_n_hours: How often checkpoints should be kept.
          Defaults to 10,000 hours.
        name: String.  Optional name to use as a prefix when adding operations.
        restore_sequentially: A Bool, which if true, causes restore of different
          variables to happen sequentially within each device.
        filename: If known at graph construction time, filename used for variable
          loading/saving.
  
      Returns:
        A SaverDef proto.
  
      Raises:
        TypeError: If 'names_to_variables' is not a dictionary mapping string
          keys to variable Tensors.
        ValueError: If any of the keys or values in 'names_to_variables' is not
          unique.
      """
      vars_to_save = self._ValidateAndSliceInputs(names_to_variables)
      if max_to_keep is None:
        max_to_keep = 0
  
      with ops.op_scope([vs.var for vs in vars_to_save], name, "save") as name:
        # Add the Constant string tensor for the filename.
        filename_tensor = constant_op.constant(filename)
  
        # Add the save ops.
        if sharded:
          per_device = self._GroupByDevices(vars_to_save)
          save_tensor = self._AddShardedSaveOps(filename_tensor, per_device)
          restore_op = self._AddShardedRestoreOps(
              filename_tensor, per_device, restore_sequentially, reshape)
        else:
          save_tensor = self._AddSaveOps(filename_tensor, vars_to_save)
          restore_op = self._AddRestoreOps(
              filename_tensor, vars_to_save, restore_sequentially, reshape)
  
      assert restore_op.name.endswith("restore_all"), restore_op.name
  
      return saver_pb2.SaverDef(
          filename_tensor_name=filename_tensor.name,
          save_tensor_name=save_tensor.name,
          restore_op_name=restore_op.name,
          max_to_keep=max_to_keep,
          keep_checkpoint_every_n_hours=keep_checkpoint_every_n_hours,
          sharded=sharded)
function_tokens: def build ( self , names_to_variables , reshape = False , sharded = False , max_to_keep = 5 , keep_checkpoint_every_n_hours = 10000.0 , name = None , restore_sequentially = False , filename = "model" ) : vars_to_save = self . _ValidateAndSliceInputs ( names_to_variables ) if max_to_keep is None : max_to_keep = 0 with ops . op_scope ( [ vs . var for vs in vars_to_save ] , name , "save" ) as name : # Add the Constant string tensor for the filename. filename_tensor = constant_op . constant ( filename ) # Add the save ops. if sharded : per_device = self . _GroupByDevices ( vars_to_save ) save_tensor = self . _AddShardedSaveOps ( filename_tensor , per_device ) restore_op = self . _AddShardedRestoreOps ( filename_tensor , per_device , restore_sequentially , reshape ) else : save_tensor = self . _AddSaveOps ( filename_tensor , vars_to_save ) restore_op = self . _AddRestoreOps ( filename_tensor , vars_to_save , restore_sequentially , reshape ) assert restore_op . name . endswith ( "restore_all" ) , restore_op . name return saver_pb2 . SaverDef ( filename_tensor_name = filename_tensor . name , save_tensor_name = save_tensor . name , restore_op_name = restore_op . name , max_to_keep = max_to_keep , keep_checkpoint_every_n_hours = keep_checkpoint_every_n_hours , sharded = sharded )