if self.dynamic_quantization or self.static_quantization or self.quantization_aware:
q_func = QFunctional()
q_add = q_func.add(self.field_cov.weight().t(), self.field_cov.weight())
q_add_mul = q_func.mul_scalar(q_add, 0.5)
outer_fwfm = torch.einsum('klij,kl->klij', outer_fm, q_add_mul)
return _VF.einsum(equation, operands)
RuntimeError: Could not run 'aten::mul.Tensor' with arguments from the 'QuantizedCPU' backend. 'aten::mul.Tensor' is only available for these backends: [CPU, CUDA, MkldnnCPU, SparseCPU, SparseCUDA, Named, Autograd, Profiler, Tracer, Batched].
Can torch.einsum(...) be quantized? Would there be a workaround since it consists of mulitplication and addition?
hi @pintonos, currently we don’t have a quantized kernel for einsum, we would be happy to review a PR if someone is interested in implementing. In the meanwhile, a workaround could be to dequantize -> floating point einsum -> quantize.