Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request #10

Open
gualandri43 opened this issue Sep 9, 2016 · 6 comments
Open

Feature Request #10

gualandri43 opened this issue Sep 9, 2016 · 6 comments

Comments

@gualandri43
Copy link

Are there plans to implement ArrayFire's GFOR capability in this wrapper? I noticed a "broadcast" function in the python wrapper that looks similar.

@shehzan10
Copy link
Member

Most of the functions that are supported in GFor also normally support batching. For example, if you wanted to do a convolve on a 2D image, you can have multiple 2D images batching into a 3D array and run the convolve on that.
Is there any specific function that you would like supported?

@gualandri43
Copy link
Author

Essentially what I am looking to do is pretty simple, add different size arrays together(i.e. a 3 row x 1 col array + 3 row by 5 col array, add the 3x1 to each column of the 3x5) or perform a custom function on all rows of an array. I.e., apply function f(x1,x2,x3,x4,x5) to n times to rows of array y[n row x 5 cols]. I apologize if this functionality can be accomplished with functions already implemented, I am a newbie in regards to ArrayFire, but looking to learn!

@pavanky
Copy link
Member

pavanky commented Sep 9, 2016

@gualandri43 In these cases tile should do it. It does not actually replicate the arrays but just changes the metdata.

I am giving the example in C++, you can probably figure it for C#.

array a = randu(3,1);
array b = randu(3, 5);
array c = tile(a, 1, 5) + b;

This works.

Alternatively, there is a function called batchFunc in arrayfire that can be used if ported.

array a = randu(3, 1);
array b = randu(3, 5);
array c = batchFunc(a, b, [](const array &aa, const array &bb){ return aa + bb;});

@gualandri43
Copy link
Author

@pavanky Thank you for the suggestion about tiling, that should take care of the first part quite nicely.

batchFunc looks exactly like what I was thinking for the second part (apply custom function across rows of array). Is that able to be ported over?

@pavanky
Copy link
Member

pavanky commented Sep 9, 2016

@gualandri43 you shouldn't need either GFOR or batchfunc for the second part. All our functions work on all the vectors in parallel.

If you have a specific code that you are having a problem with, drop by on our chat room and we'll see if we can help you out: https://gitter.im/arrayfire/arrayfire

@gualandri43
Copy link
Author

Alright, I will experiment further and see what I can figure out. Thanks again!

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

No branches or pull requests

3 participants