Spec-Zone.ru › PyTorch 2

LazyLinear

class torch.nn.LazyLinear(out_features, bias=True, device=None, dtype=None) [source]

A torch.nn.Linear module where in_features is inferred.

In this module, the weight and bias are of torch.nn.UninitializedParameter class. They will be initialized after the first call to forward is done and the module will become a regular torch.nn.Linear module. The in_features argument of the Linear is inferred from the input.shape[-1].

Check the torch.nn.modules.lazy.LazyModuleMixin for further documentation on lazy modules and their limitations.

Parameters
  • out_features (int) – размер каждого выходного образца
  • bias (UninitializedParameter) – Если установлено в False, слой не будет обучать аддитивное смещение. По умолчанию: True
Variables
  • weight (torch.nn.parameter.UninitializedParameter) – обучаемые веса модуля формы (out_features,in_features)(\text{out\_features}, \text{in\_features}). Значения инициализируются из U(−k,k)\mathcal{U}(-\sqrt{k}, \sqrt{k}), где k=1in_featuresk = \frac{1}{\text{in\_features}}
  • bias (torch.nn.parameter.UninitializedParameter) – обучаемое смещение модуля формы (out_features)(\text{out\_features}). Если bias равно True, значения инициализируются из U(−k,k)\mathcal{U}(-\sqrt{k}, \sqrt{k}) где k=1in_featuresk = \frac{1}{\text{in\_features}}
cls_to_become

псевдоним Linear

© 2024, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://pytorch.org/docs/2.1/generated/torch.nn.LazyLinear.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API