FunctionRacerProblemsRace

Only the Positives

EasyPyTorchPython

Return the elements of the 1-D tensor x that are greater than 0, in the order they come.

Example 1

x [1.5,-2.0,0.0,3.0]
returns [1.5,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