You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Actually, I'm now wondering if we should add a keepdims=True to linspace, with semantics "replace the axisth axis with the new linspace and squeeze". @mhvk, do you have thoughts on this?
@eric-wieser - you mean something like the opposite of a reduction, where keepdims=True tells linspace that there is already a dimension of 1 inside start and stop? On the one hand, it doesn't quite feel as natural, since in that case one has to check that that dimension is indeed 1. On the other hand, I can see the nice aspect that then start and stop would broadcast with the result. Overall, the "other hand" wins for me...
Activity
zjpoh commentedon Nov 15, 2019
Hey @eric-wieser, I'm interested to take a look at this.
Just to make sure I understand the requirements.
So, we basically want to add a
keep_dimparameter tonp.linspaceso that its output has the same dimension asarr_minandarr_max?zjpoh commentedon Dec 11, 2019
I agree with @efiring that the usage of this new keyword might not very common and so does not worth the complexity it adds.
In addition, as pointed out by @shoyer, one can achieve the same goal with the following code:
So, I'm closing this PR and the associated issue.
Please refer to the PR for more comments.
seberg commentedon Dec 11, 2019
Thanks for the effort ZJ! Sometimes its necessary to propose a solution to get a resolution unfortunately.
zjpoh commentedon Dec 11, 2019
No worries. It's a good learning opportunity for me. 😄
eric-wieser commentedon Dec 11, 2019
Sorry for the wild goose chase - I think the arguments made on the mailing list are pretty reasonable :)