快捷方式

Conv3d

torch.ao.nn.quantized.Conv3d(in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1, groups=1, bias=True, padding_mode='zeros', device=None, dtype=None)[source][source]

对由多个量化输入平面组成的量化输入信号应用 3D 卷积。

有关输入参数、参数和实现的详细信息,请参阅 Conv3d

注意

padding_mode 参数仅支持 zeros

注意

输入数据类型仅支持 torch.quint8

变量
  • weight (Tensor) – 从可学习的 weight 参数派生的 packed tensor。

  • scale (Tensor) – 输出 scale 的标量

  • zero_point (Tensor) – 输出 zero point 的标量

有关其他属性,请参阅 Conv3d

示例

>>> # With square kernels and equal stride
>>> m = nn.quantized.Conv3d(16, 33, 3, stride=2)
>>> # non-square kernels and unequal stride and with padding
>>> m = nn.quantized.Conv3d(16, 33, (3, 5, 5), stride=(1, 2, 2), padding=(1, 2, 2))
>>> # non-square kernels and unequal stride and with padding and dilation
>>> m = nn.quantized.Conv3d(16, 33, (3, 5, 5), stride=(1, 2, 2), padding=(1, 2, 2), dilation=(1, 2, 2))
>>> input = torch.randn(20, 16, 56, 56, 56)
>>> # quantize input to quint8
>>> q_input = torch.quantize_per_tensor(input, scale=1.0, zero_point=0, dtype=torch.quint8)
>>> output = m(q_input)
类方法 from_float(mod, use_precomputed_fake_quant=False)[source][source]

从 float 模块或 qparams_dict 创建量化模块。

参数

mod (Module) – 一个 float 模块,可由 torch.ao.quantization 工具生成或由用户提供

文档

查阅 PyTorch 全面的开发者文档

查看文档

教程

获取针对初学者和高级开发者的深入教程

查看教程

资源

查找开发资源并获得解答

查看资源