Parameter — PyTorch 2.4 documentation
Parameters are Tensor subclasses, that have a very special property when used with Module s - when they’re assigned as Module attributes they are automatically added to the list of its parameters, and will appear e.g. in parameters() iterator. Assigning a Tensor doesn’t have such effect. This is because one might want to cache some temporary state, like last hidden state of the RNN, in the model. If there was no such class as Parameter, these temporaries would get registered too. data (Tensor) – parameter tensor. requires_grad (bool, optional) – if the parameter requires gradient. Note that the torch.no_grad() context does NOT affect the default behavior of Parameter creation–the Parameter will still have requires_grad=True in no_grad mode. See Locally disabling gradient computation for more details. Default: True © Copyright 2023, PyTorch Contributors. Access comprehensive developer documentation for PyTorch Get in-depth tutorials for beginners and advanced developers Find development
Redirecting… Continue to ../../2.13/generated/torch.nn.parameter.Parameter.html
Explore this link on the map →related reading
- python - Understanding `torch.nn.Parameter()` - Stack Overflowstackoverflow.com
- PyTorch internals : ezyang's blogblog.ezyang.com
- Learning PyTorch with Examples — PyTorch Tutorials 2.12.0+cu130 documentationpytorch.org
- Building Models with PyTorch — PyTorch Tutorials 2.13.0+cu130 documentationpytorch.org
- microgptkarpathy.github.io
- Chapter 0: Fundamentals - ARENAlearn.arena.education
- PyTorch (@PyTorch) / Xx.com
- the bug that taught me more about PyTorch than years of using it | Elana Simonelanapearl.github.io
- Tensors — PyTorch Tutorials 2.12.0+cu130 documentationpytorch.org
- Redirecting…pytorch.org
- torch.Tensor — PyTorch 2.12 documentationdocs.pytorch.org
- Annotated Research Paper Implementations: Transformers, StyleGAN, Stable Diffusion, DDPM/DDIM, LayerNorm, Nucleus Sampling and morenn.labml.ai