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
numpy.concat does not appear to work across broadcast axes (Trac #1518) #2115
Comments
trac user eob wrote on 2010-06-22 Note: the workaround we are using is to tile the numpy.array that we wanted to use newaxis on, which works but at the expense of memory. |
@pv wrote on 2010-06-24 Can you write a self-contained piece of example code showing what you are trying to do, what you would like to happen, and what actually happens. From your description, it's not completely clear to me how you'd like things to work. |
@pv wrote on 2010-06-24 If you mean this,
you can do it without copies:
But yes, I guess |
Any news/progress on |
There has been some discussions about this on the list in the past, and the collective wisdom dictated that broadcasting in a concatenate operation was more likely to be masking unintended mistakes, than a useful functionality. We probably should close this. In any case, if you would like to stirr that conversation up again, the right place would be the mailing list, not here. |
Should this be closed as a "won't fix"? |
Agreed. Note that manual broadcasting is now a little bit easier because we have broadcast_to. |
I just needed a tiny bit of positive reinforcement, closed it is. If anyone has a strong opinion against this, feel free to reopen. |
I found a solution that seems solid to me... just use broadcast_arrays in the form |
@davidmashburn I think there is a problem with this solution (and with manual broadcasting in general as suggested by others in this thread). I don't think it makes sense to broadcast in the dimension in which we concatenate. In other words, in your case I would only expect to end up with one column of zeros. |
If someone else also finds this Issue, while searching for a solution of broadcasting in concatenate, I posted my solution at https://stackoverflow.com/questions/56357047/concatenate-with-broadcast/61061019#61061019 |
Original ticket http://projects.scipy.org/numpy/ticket/1518 on 2010-06-22 by trac user eob, assigned to unknown.
When I'm trying to concatenate two tensors together, the concatenate operation does not allow me to use broadcast dimensions (using newaxis) in one of them.
The text was updated successfully, but these errors were encountered: