Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

how to reduce a one-dimension tensor (vector) ? #278

Open
buaasun opened this issue Aug 4, 2017 · 1 comment
Open

how to reduce a one-dimension tensor (vector) ? #278

buaasun opened this issue Aug 4, 2017 · 1 comment

Comments

@buaasun
Copy link

buaasun commented Aug 4, 2017

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?

@szha
Copy link
Member

szha commented Aug 4, 2019

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants