parameters: (self,
                       filename_tensor,
                       saveables,
                       restore_sequentially,
                       reshape,
                       preferred_shard=-1,
                       name="restore_all")
return_statement: return control_flow_ops.group(*assign_ops, name=name)
docstring: Add operations to restore saveables.
  
      Args:
        filename_tensor: Tensor for the path of the file to load.
        saveables: A list of SaveableObject objects.
        restore_sequentially: True if we want to restore variables sequentially
          within a shard.
        reshape: True if we want to reshape loaded tensors to the shape of
          the corresponding variable.
        preferred_shard: Shard to open first when loading a sharded file.
        name: Name for the returned op.
  
      Returns:
        An Operation that restores the variables.
docstring_summary: Add operations to restore saveables.
docstring_tokens: Add operations to restore saveables .
function: def _AddRestoreOps(self,
                       filename_tensor,
                       saveables,
                       restore_sequentially,
                       reshape,
                       preferred_shard=-1,
                       name="restore_all"):
      """Add operations to restore saveables.
  
      Args:
        filename_tensor: Tensor for the path of the file to load.
        saveables: A list of SaveableObject objects.
        restore_sequentially: True if we want to restore variables sequentially
          within a shard.
        reshape: True if we want to reshape loaded tensors to the shape of
          the corresponding variable.
        preferred_shard: Shard to open first when loading a sharded file.
        name: Name for the returned op.
  
      Returns:
        An Operation that restores the variables.
      """
      assign_ops = []
      for saveable in saveables:
        restore_control_inputs = assign_ops[-1:] if restore_sequentially else []
        # Load and optionally reshape on the CPU, as string tensors are not
        # available on the GPU.
        # TODO(touts): Re-enable restore on GPU when we can support annotating
        # string tensors as "HostMemory" inputs.
        with ops.device(_set_cpu0(saveable.device) if saveable.device else None):
          with ops.control_dependencies(restore_control_inputs):
            tensors = self.restore_op(filename_tensor, saveable, preferred_shard)
            shapes = None
            if reshape:
              # Compute the shapes, let the restore op decide if and how to do
              # the reshape.
              shapes = []
              for spec in saveable.specs:
                v = spec.tensor
                shape = v.get_shape()
                if not shape.is_fully_defined():
                  shape = array_ops.shape(v)
                shapes.append(shape)
            assign_ops.append(saveable.restore(tensors, shapes))
  
        # Create a Noop that has control dependencies from all the updates.
      return control_flow_ops.group(*assign_ops, name=name)
function_tokens: def _AddRestoreOps ( self , filename_tensor , saveables , restore_sequentially , reshape , preferred_shard = - 1 , name = "restore_all" ) : assign_ops = [ ] for saveable in saveables : restore_control_inputs = assign_ops [ - 1 : ] if restore_sequentially else [ ] # Load and optionally reshape on the CPU, as string tensors are not # available on the GPU. # TODO(touts): Re-enable restore on GPU when we can support annotating # string tensors as "HostMemory" inputs. with ops . device ( _set_cpu0 ( saveable . device ) if saveable . device else None ) : with ops . control_dependencies ( restore_control_inputs ) : tensors = self . restore_op ( filename_tensor , saveable , preferred_shard ) shapes = None if reshape : # Compute the shapes, let the restore op decide if and how to do # the reshape. shapes = [ ] for spec in saveable . specs : v = spec . tensor shape = v . get_shape ( ) if not shape . is_fully_defined ( ) : shape = array_ops . shape ( v ) shapes . append ( shape ) assign_ops . append ( saveable . restore ( tensors , shapes ) ) # Create a Noop that has control dependencies from all the updates. return control_flow_ops . group ( * assign_ops , name = name )