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

Function prelu

imperative/python/megengine/functional/nn.py:874–876  ·  view source on GitHub ↗

r"""Element-wise `max(x, 0) + y * min(x, 0)`.

(x, y)

Source from the content-addressed store, hash-verified

872
873
874def prelu(x, y):
875 r"""Element-wise `max(x, 0) + y * min(x, 0)`."""
876 return _elwise(x, y, mode=Elemwise.Mode.PRELU)
877
878
879def leaky_relu(inp: Tensor, negative_slope: float = 0.01) -> Tensor:

Callers 2

forwardMethod · 0.50
test_preluFunction · 0.50

Calls 1

_elwiseFunction · 0.50

Tested by 1

test_preluFunction · 0.40