QuantizedConv2DTranspose¶
- class paddle.nn.quant.quant_layers. QuantizedConv2DTranspose ( layer, weight_bits=8, activation_bits=8, moving_rate=0.9, weight_quantize_type='abs_max', activation_quantize_type='abs_max', weight_pre_layer=None, act_pre_layer=None, weight_quant_layer=None, act_quant_layer=None ) [source]
-
The computational logic of QuantizedConv2DTranspose is the same with Conv2DTranspose. The only difference is that its inputs are all fake quantized.
Examples
>>> import paddle >>> import paddle.nn as nn >>> from paddle.nn.quant.quant_layers import QuantizedConv2DTranspose >>> x_var = paddle.uniform((2, 4, 8, 8), dtype='float32', min=-1., max=1.) >>> conv = nn.Conv2DTranspose(4, 6, (3, 3)) >>> conv_quantized = QuantizedConv2DTranspose(conv) >>> y_quantized = conv_quantized(x_var) >>> y_var = conv(x_var) >>> print(y_var.shape) [2, 6, 10, 10] >>> print(y_quantized.shape) [2, 6, 10, 10]
-
forward
(
input,
output_size=None
)
forward¶
-
Defines the computation performed at every call. Should be overridden by all subclasses.
- Parameters
-
*inputs (tuple) – unpacked tuple arguments
**kwargs (dict) – unpacked dict arguments
-
forward
(
input,
output_size=None
)