FunctionRacerProblemsRace

Add Them Up

BeginnerPyTorchPython

Return the sum of all the elements of the tensor x, whatever its shape.

Example 1

x [1.0,2.0,3.5]
returns 6.5

Example 2

x [[1.0,2.0],[3.0,4.0]]
returns 10.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