Premium problem40. ReLU

Easy Locked

Apply the ReLU activation to tensor x: replace every negative element with 0, leaving non-negative elements unchanged.

Input

tensor([-2.0000, -0.5000,  0.0000,  1.5000,  3.0000])

Output

tensor([0.0000, 0.0000, 0.0000, 1.5000, 3.0000])

Premium problem

This one's part of Premium. Unlock the full PyTorch track plus every other premium problem on the site.

Implement solve(...)