FunctionRacerProblemsRace

Floor at Zero

EasyPyTorchPython

Return x with every negative element replaced by 0. The other elements stay as they are. Networks do this between their layers, under the name ReLU.

Example 1

x [1.5,-2.0,0.0,3.0]
returns [1.5,0.0,0.0,3.0]

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More PyTorch problems