0

I try to quantize nn.LogSoftmax in my model. But ı don't find right configs. Any idea ?

it's dynamic quantize, ı can try static quantize if it possible.

qconfig_spec = {
        nn.Embedding: float_qparams_weight_only_qconfig,
        nn.Linear: default_dynamic_qconfig,
        nn.LSTM: default_dynamic_qconfig,
        nn.LogSoftmax: ????????????????

    }

    model_to_quantize = copy.deepcopy(MODEL)

    quantized_model = torch.quantization.quantize_dynamic(model_to_quantize, qconfig_spec, dtype=torch.qint8)

Try to quantize LogSoftmax, my real purpose is using the quantized model on tensorrt

Umut Ucay
  • 5
  • 3
  • According to the [docs](https://pytorch.org/docs/stable/quantization.html), the dynamic quantization for *activations* states `Un-changed, computations stay in fp32`. So i'd guess it works by default? – Plagon Feb 07 '23 at 14:27

0 Answers0