Skip to content

Feature Request #10

Description

@gualandri43

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

Activity

  1. shehzan10 commented on Sep 9, 2016

    @shehzan10
    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?

  2. gualandri43 commented on Sep 9, 2016

    @gualandri43
    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!

  3. pavanky commented on Sep 9, 2016

    @pavanky
    Member

    @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;});
    
  4. gualandri43 commented on Sep 9, 2016

    @gualandri43
    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?

  5. pavanky commented on Sep 9, 2016

    @pavanky
    Member

    @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

  6. gualandri43 commented on Sep 9, 2016

    @gualandri43
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions