<div dir="ltr">ok good, 'reshape' behaves as it should; but what's the rationale for not throwing on '<span style="font-size:12.8px">iota(5).sliced(2,2) ' ?</span><div><div><br></div></div><div>in light of what i wrote above, it's surprising behavior and will cause bugs. What are the advantages of allowing it to not throw?</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 8, 2016 at 6:09 PM, Ilya via Digitalmars-d <span dir="ltr"><<a href="mailto:digitalmars-d@puremagic.com" target="_blank">digitalmars-d@puremagic.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Saturday, 9 January 2016 at 00:15:10 UTC, Timothee Cour wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
I'm not sure I understand your argument.<br>
My problem is that iota(5) has 5 elements which is more than 2*2, so I<br>
would expect<br>
iota(5).sliced(2,2)<br>
or<br>
iota(7).sliced(2,3).sliced(1,2)<br>
to throw, as in pretty much any other tensor library:<br>
<br></span>
[...]<br>
</blockquote>
<br>
auto a = iota(5).sliced(5);<br>
auto b = a.reshape(2, 2); // throws ReshapeException<span class="HOEnZb"><font color="#888888"><br>
--ilya<br>
</font></span></blockquote></div><br></div>