Biggest and Where
Return a list of two things about the 1-D tensor x: its largest element, and the position of that element (0 for the first).
Example 1
x [3.0,9.5,-1.0]
returns [9.5,1]
Constraints
- 1 to 8 elements, all different
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More PyTorch problems
- Column AveragesBeginner
- Count UpBeginner
- Dot ProductBeginner
- HalvesBeginner
- The Last ColumnBeginner
- The ShapeBeginner
- Twice Plus OneBeginner
- Two RowsBeginner