快速鍵

linear

class torch.ao.nn.quantized.functional.linear(input, weight, bias=None, scale=None, zero_point=None)[source][source]

對傳入的量化資料應用線性轉換:y=xAT+by = xA^T + b。 請參閱 Linear

注意

目前的實作在每次呼叫時都會封裝權重,這會對效能造成影響。如果您想避免這種額外負擔,請使用 Linear

參數
  • input (Tensor) – torch.quint8 類型的量化輸入

  • weight (Tensor) – torch.qint8 類型的量化權重

  • bias (Tensor) – torch.float 類型的 None 或 fp32 偏差

  • scale (double) – 輸出比例。 如果為 None,則從輸入比例推導

  • zero_point (python:long) – 輸出零點。 如果為 None,則從輸入零點推導

回傳類型

Tensor

形狀
  • Input: (N,,in_features)(N, *, in\_features) 其中 * 代表任意數量的額外維度

  • Weight: (out_features,in_features)(out\_features, in\_features)

  • Bias: (out_features)(out\_features)

  • Output: (N,,out_features)(N, *, out\_features)

文件

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