-
Notifications
You must be signed in to change notification settings - Fork 69
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
Broadcasting? #108
Comments
Are you comparing Fastor with MATLAB/Fortran/Julia style broadcasting? Note that Fastor tensors are row-major (C-style or NumPy style) so the order is swapped in that: Tensor<double,3> vec = {1,2,3}; // a vector
Tensor<double,2,4,3> A(0); // 3D tensor of all zeros
A(0,0,all) = vec(all);
print(A); will print
Here A is a 3D tensor made up of two So in So in Hope that is clear. |
I see ... so by "assign a vector to all the columns" you mean that each column gets one different element of the vector. |
Right I see that the documentation is incorrect. I will correct that. We don't have much documentation for Fastor at the moment. What you are asking is essentially tiling Something like Tensor<double,1,3> vec = {{1,2,3}};
Tensor<double,3,3> A = repeat<1,3>(vec); // repeat 3 times, column-wise (1 for column-wise and 3 for number of repetition)
For the time being however, unfortunately you will have to implement this with for loops |
Thanks, that's very clarifying. Maybe I can try to stub an interface out with a naive implementation if I am bored, and submit a PR. |
You are welcome to submit a PR if you wish |
Also see #103 |
I'm unsure how to broadcast assignment to across columns or rows.
The wiki states:
But this looks like it selects the first column and first row (index 0,0): what is the actual situation here?
The text was updated successfully, but these errors were encountered: