I want to perform dynamic quantization on a FwFM model (paper 1). Unfortunately, i did not manage to make it work!
I get following error:
AttributeError: 'function' object has no attribute 't'

corresponding to the line in my forward function:
outer_fwfm = torch.einsum('klij,kl->klij', outer_fm,
                                              (self.field_cov.weight.t() + self.field_cov.weight) * 0.5)

Corresponding model layer before quantization:
(field_cov): Linear(in_features=39, out_features=39, bias=False)

After quantization:
(field_cov): DynamicQuantizedLinear(in_features=39, out_features=39, dtype=torch.qint8, qscheme=torch.per_tensor_affine)

Quantization line:
quantized_model = torch.quantization.quantize_dynamic(model, {torch.nn.Linear}, dtype=torch.qint8)

Am I missing something out here? Thanks for your help!
GitHub Code 3