Perform sum reduction over a specified dimension of an input tensor:
where is the dimension to reduce over, is the number of dimensions, and is the size of dimension .
input of arbitrary shape dim (): Dimension to reduce over (0-based indexing)shape: Array containing the dimensions of the input tensorndim (): Number of dimensions in the input tensoroutput with shape
GPU Type
Language
Data Type
Loading editor...
CUDA C++ environment
Sample Run Results
Hit "Run" to test your code with sample inputs
For the best coding experience, please switch to a desktop device to write and submit your solution.