MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / __init__

Method __init__

python/paddle/nn/quant/quant_layers.py:1134–1151  ·  view source on GitHub ↗

r""" Construct

(
        self,
        layer: Layer | None = None,
        moving_rate: float = 0.9,
        name: str | None = None,
        dtype: DTypeLike = 'float32',
        reduce_type: Literal['max'] | None = None,
    )

Source from the content-addressed store, hash-verified

1132 """
1133
1134 def __init__(
1135 self,
1136 layer: Layer | None = None,
1137 moving_rate: float = 0.9,
1138 name: str | None = None,
1139 dtype: DTypeLike = 'float32',
1140 reduce_type: Literal['max'] | None = None,
1141 ) -> None:
1142 r"""
1143 Construct
1144 """
1145 super().__init__()
1146 self._layer = layer
1147 if name is None:
1148 name = layer.full_name()
1149 self._ma_output_scale = MovingAverageAbsMaxScale(
1150 name, moving_rate, dtype, reduce_type
1151 )
1152
1153 def forward(self, *inputs: Any, **kwargs: Any) -> Tensor:
1154 out = self._layer(*inputs, **kwargs)

Callers

nothing calls this directly

Calls 3

full_nameMethod · 0.80
__init__Method · 0.45

Tested by

no test coverage detected