Table of Contents
Shortcuts

# torch.nn.utils.prune.remove

torch.nn.utils.prune.remove(module, name)

  Removes the pruning reparameterization from a module and the pruning method from the forward hook. The pruned parameter named `name` remains permanently pruned, and the parameter named `name+'_orig'` is removed from the parameter list. Similarly, the buffer named `name+'_mask'` is removed from the buffers.

  Note

  Pruning itself is NOT undone or reversed!

  Parameters:

    - module (nn.Module) – module containing the tensor to prune

    - name (str) – parameter name within `module` on which pruning will act.

  Examples

      >>> m = random_unstructured(nn.Linear(5, 7), name='weight', amount=0.2)
      >>> m = remove(m, name='weight')

## Docs

Access comprehensive developer documentation for PyTorch

View Docs

## Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

## Resources

Find development resources and get your questions answered

View Resources

To analyze traffic and optimize your experience, we serve cookies on this site. By clicking or navigating, you agree to allow our usage of cookies. As the current maintainers of this site, Facebook’s Cookies Policy applies. Learn more, including about available controls: Cookies Policy.