Skip to content
fn

leaky_mask_storage

→Storage
int leaky_mask_storage(const int & s, double slope, int numel, Dtype dt, Device device)

LeakyReLU gradient mask: returns 1 where s >= 0 else slope.

Parameters

sconst Storage&
Input buffer (LeakyReLU's saved input).
slopedouble
Negative-side slope; the LeakyReLU's negative_slope parameter.
numelstd::size_t
Number of elements.
dtDtype
Output dtype.
deviceDevice
Target device.

Returns

Storage

New storage suitable for element-wise multiplication into grad_output.