You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

quant_dequant.py 555 B

12345678910111213141516171819
  1. from .module import Module
  2. class QuantStub(Module):
  3. r"""A helper :class:`~.Module` simply returning input. Could be replaced with :class:`~.QATModule`
  4. version :class:`~.qat.QuantStub` using :func:`~.quantize.quantize_qat`.
  5. """
  6. def forward(self, inp):
  7. return inp
  8. class DequantStub(Module):
  9. r"""A helper :class:`~.Module` simply returning input. Could be replaced with :class:`~.QATModule`
  10. version :class:`~.qat.DequantStub` using :func:`~.quantize.quantize_qat`.
  11. """
  12. def forward(self, inp):
  13. return inp