We can't find the internet
Attempting to reconnect
Something went wrong!
Attempting to reconnect
← Activations step 1 of 9
Easy
Primitives
Implement ReLU
Implement the ReLU (Rectified Linear Unit) activation function.
$$\text{ReLU}(x) = \max(0, x)$$
Input: A tensor x of any shape
Output: A tensor of the same shape with all negative values replaced by 0
Loading visualization…
Nothing accepted yet. When a submission passes, the code that passed shows up
here, one entry per mode.
Stuck?
PyTorch reference solution
Sign in to attempt this problem and reveal the reference solution.