mshadow
mshadow copied to clipboard
how to reduce a one-dimension tensor (vector) ?
I know there are functions for reduce a multi-dimension tensor: reduce_with_axis
, reduce_except_dim
... but I can't any for one-dimension tensor?
for example: I want to get the sum of a vector, I need function like below
Tensor<cpu,1,int> vec={1,2,3};
int s=reduce<red::sum>(vec);
// s should be 6
How do I achieve this in mshadow?
This code base has been donated to the Apache MXNet project per #373, and repo is deprecated. Future development and issue tracking should continue in Apache MXNet.