r"""A :class:`~.Module` to do :mod:`~.functional.elemwise` operator. Could be replaced with :class:`~.QATModule` version :class:`~.qat.Elemwise` using :func:`~.quantize.quantize_qat`. Args: method: the elemwise method, support the following string. It will do the nor
| 4 | |
| 5 | |
| 6 | class Elemwise(Module): |
| 7 | r"""A :class:`~.Module` to do :mod:`~.functional.elemwise` operator. Could be replaced with :class:`~.QATModule` |
| 8 | version :class:`~.qat.Elemwise` using :func:`~.quantize.quantize_qat`. |
| 9 | |
| 10 | Args: |
| 11 | method: the elemwise method, support the following string. |
| 12 | It will do the normal elemwise operator for float. |
| 13 | """ |
| 14 | |
| 15 | def __init__(self, method, **kwargs): |
| 16 | super().__init__(**kwargs) |
| 17 | self.method = method |
| 18 | |
| 19 | def forward(self, *inps): |
| 20 | return _elwise(*inps, mode=self.method) |
no outgoing calls