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

Function leaky_relu

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

r"""Element-wise LeakyReLU function Refer to :class:`~.module.LeakyReLU` for more information.

(inp: Tensor, negative_slope: float = 0.01)

Source from the content-addressed store, hash-verified

877
878
879def leaky_relu(inp: Tensor, negative_slope: float = 0.01) -> Tensor:
880 r"""Element-wise LeakyReLU function
881
882 Refer to :class:`~.module.LeakyReLU` for more information.
883 """
884 return _elwise(inp, negative_slope, mode=Elemwise.Mode.PRELU)
885
886
887def silu(x):

Callers 2

forwardMethod · 0.85
test_leaky_reluFunction · 0.85

Calls 1

_elwiseFunction · 0.50

Tested by 1

test_leaky_reluFunction · 0.68