shouldn't this throw ? iota(5).sliced(2,2)

Ilya via Digitalmars-d digitalmars-d at puremagic.com
Fri Jan 8 18:09:25 PST 2016


On Saturday, 9 January 2016 at 00:15:10 UTC, Timothee Cour wrote:
> I'm not sure I understand your argument.
> My problem is that iota(5) has 5 elements which is more than 
> 2*2, so I
> would expect
> iota(5).sliced(2,2)
> or
> iota(7).sliced(2,3).sliced(1,2)
> to throw, as in pretty much any other tensor library:
>
> [...]

auto a = iota(5).sliced(5);
auto b = a.reshape(2, 2); // throws ReshapeException
--ilya


More information about the Digitalmars-d mailing list