Yes, I agree that this bit is inconsistent.
On Tue, May 13, 2014 at 9:20 AM, Milan Bouchet-Valat wrote:
> Le lundi 12 mai 2014 à 23:11 -0700, Ganesh Rapolu a écrit :
>
> I don't have any experience with tensors but it seems, at least on the
> surface, that the convenience is not worth allowing
Le lundi 12 mai 2014 à 23:11 -0700, Ganesh Rapolu a écrit :
> I don't have any experience with tensors but it seems, at least on the
> surface, that the convenience is not worth allowing the bugs that
> could be prevented by enforcing 1 <= n <= ndims(A).
>
> However if that was the correct way to
The current behavior is useful in a number of contexts; for example, you can
write algorithms that take either a Vector or Matrix input without having to
reshape to a matrix. Note that you can index a vector as v[i,1] without error,
too.
But if you have a compelling example of where this leads
I don't have any experience with tensors but it seems, at least on the
surface, that the convenience is not worth allowing the bugs that could be
prevented by enforcing 1 <= n <= ndims(A).
However if that was the correct way to do things, then I would expect this
to work (viewing a scalar as a
Pull request: https://github.com/JuliaLang/julia/pull/6828.
On Tue, May 13, 2014 at 1:35 AM, Stefan Karpinski wrote:
> The idea is that you can treat lower dimensional tensors as if they were
> higher dimensional with trailing singleton dimensions. Thus, if you have a
> vector – i.e. an array wi
The idea is that you can treat lower dimensional tensors as if they were
higher dimensional with trailing singleton dimensions. Thus, if you have a
vector – i.e. an array with a single dimension – but you want to treat it
as a matrix, you can do
m, n = size(x,1), size(x,2)
and it will work. Speak
For an array A if n > ndims(A), then size(A,n) currently returns 1. Is this
an error or is there some reasoning behind this? It does the right thing
(gives an error saying "dimension out of range") when n <= 0. Also I wanted
to add that I am enjoying Julia a lot! You guys did a great job with th