MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / Elemwise

Class Elemwise

imperative/python/megengine/module/elemwise.py:6–20  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

4
5
6class 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)

Callers 12

test_funcFunction · 0.90
test_replace_varsFunction · 0.50
test_replace_oprsFunction · 0.50
forwardMethod · 0.50
_elwiseFunction · 0.50
elemwiseFunction · 0.50
test_opr_attrFunction · 0.50
test_raw_tensorFunction · 0.50
test_opFunction · 0.50
test_exceptionFunction · 0.50

Calls

no outgoing calls

Tested by 12

test_funcFunction · 0.72
test_replace_varsFunction · 0.40
test_replace_oprsFunction · 0.40
forwardMethod · 0.40
_elwiseFunction · 0.40
elemwiseFunction · 0.40
test_opr_attrFunction · 0.40
test_raw_tensorFunction · 0.40
test_opFunction · 0.40
test_exceptionFunction · 0.40