<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 8, 2016 at 10:07 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:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">On Saturday, 9 January 2016 at 04:15:08 UTC, Timothee Cour wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">
ok good, 'reshape' behaves as it should; but what's the rationale for not<br>
throwing on 'iota(5).sliced(2,2) ' ?<br>
<br>
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?<br>
<br>
<br>
On Fri, Jan 8, 2016 at 6:09 PM, Ilya via Digitalmars-d < <a href="mailto:digitalmars-d@puremagic.com" target="_blank">digitalmars-d@puremagic.com</a>> wrote:<br>
<br>
</span><div><div class="h5"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
On Saturday, 9 January 2016 at 00:15:10 UTC, Timothee Cour wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
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>
[...]<br>
<br>
</blockquote>
<br>
auto a = iota(5).sliced(5);<br>
auto b = a.reshape(2, 2); // throws ReshapeException<br>
--ilya<br>
</blockquote></div></div></blockquote>
<br>
Agreed. I will add optional exception (by default sliced will trow).<span class=""><font color="#888888"><br>
--Ilya<br>
</font></span></blockquote></div><br></div><div class="gmail_extra">thanks!! glad we could agree on this!<br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div></div>