Rate this Page

Conv1d#

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

Applies a 1D convolution over a quantized input signal composed ofseveral quantized input planes.

For details on input arguments, parameters, and implementation seeConv1d.

Note

Onlyzeros is supported for thepadding_mode argument.

Note

Onlytorch.quint8 is supported for the input data type.

Variables
  • weight (Tensor) – packed tensor derived from the learnable weightparameter.

  • scale (Tensor) – scalar for the output scale

  • zero_point (Tensor) – scalar for the output zero point

SeeConv1d for other attributes.

Examples:

>>>m=nn.quantized.Conv1d(16,33,3,stride=2)>>>input=torch.randn(20,16,100)>>># quantize input to quint8>>>q_input=torch.quantize_per_tensor(input,scale=1.0,zero_point=0,...dtype=torch.quint8)>>>output=m(q_input)
classmethodfrom_float(mod,use_precomputed_fake_quant=False)[source]#

Creates a quantized module from a float module or qparams_dict.

Parameters

mod (Module) – a float module, either produced by torch.ao.quantizationutilities or provided by the user