# RFC: Skip Module Parameter Initialization

**URL:** <https://dev-discuss.pytorch.org/t/rfc-skip-module-parameter-initialization/207>\
**Category:** frontend API\
**Created:** [May 5, 2021, 4:46pm UTC](https://dev-discuss.pytorch.org/t/rfc-skip-module-parameter-initialization/207 "2021-05-05T16:46:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbschlosser](https://yyz2.discourse-cdn.com/flex036/user_avatar/dev-discuss.pytorch.org/jbschlosser/32/76_2.png) [@jbschlosser](https://dev-discuss.pytorch.org/u/jbschlosser)\
**Post date:** [May 5, 2021, 4:46pm UTC](https://dev-discuss.pytorch.org/t/rfc-skip-module-parameter-initialization/207/1 "2021-05-05T16:46:10Z")

</div>

### RFC: SKIP MODULE PARAMETER INITIALIZATION

Hey all, I’ve been working on enabling the ability to instantiate PyTorch modules with uninitialized parameters / buffers (see [#29523](https://github.com/pytorch/pytorch/issues/29523)). This functionality helps avoid unnecessary computation when doing non-standard parameter initialization, when loading from a serialized `state_dict` , etc.

This is currently supported by the following 2-step process:

```python
import torch

# Initialize module on the meta device.
m = torch.nn.Linear(5, 1, device='meta')

# Move module to CPU with empty / uninitialized parameters.
m.to_empty(device='cpu')

```

This is a bit arcane for the simple “skip init” use case, so I opened a [PR](https://github.com/pytorch/pytorch/pull/57555) for a helper function that will do the above in a more sugary way:

```auto
import torch

# Instantiate a module with uninitialized parameters.
m = torch.nn.utils.skip_init(torch.nn.Linear, 5, 1)

```

I’m hoping for comments / suggestions / name bikeshedding for the proposed sugary version. Please add your opinions if you have them 🙂 Thanks!
