Shortcuts

线性

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

对传入的量化数据应用线性变换: y=xAT+by = xA^T + b. 参见 Linear

注意

当前的实现每次调用都会打包权重,这会对性能产生影响。 如果您想避免这种开销,请使用 Linear

Parameters
  • 输入 (张量) – 类型为 torch.quint8 的量化输入

  • weight (张量) – 类型为 torch.qint8 的量化权重

  • bias (张量) – 类型为 torch.float 的 fp32 偏置,或为 None

  • scale (double) – 输出比例。如果为None,则从输入比例派生

  • zero_point (python:long) – 输出零点。如果为 None,则从输入 zero_point 派生

Return type

张量

Shape:
  • 输入:(N,,in_features)(N, *, in\_features) 其中 * 表示任意数量的附加维度

  • 权重: (out_features,in_features)(out\_features, in\_features)

  • 偏差: (out_features)(out\_features)

  • 输出: (N,,out_features)(N, *, out\_features)

优云智算