FunctionRacerProblemsRace

Rows That Sum to One

EasyPyTorchPython

Return the softmax of each row of the 2-D tensor x: e raised to each element, divided by the sum of those for its row. Every row then holds positive numbers that add up to 1.

Example 1

x [[0.0,0.0]]
returns [[0.5,0.5]]

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