<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Dec 10, 2014 at 4:00 PM, Nathaniel Smith <span dir="ltr"><<a href="mailto:njs@pobox.com" target="_blank">njs@pobox.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><span style="color:rgb(34,34,34)">2) Add a broadcast_to(arr, shape) function, which broadcasts the array</span><br></div></div>
to exactly the shape given, or else errors out if this is not<br>
possible.<br></blockquote><div><br></div><div>I like np.broadcast_to as a new function. We can document it alongside broadcast and broadcast_arrays under array manipulation routines, which would make it at least as discoverable as the standard broadcasting functions.</div><div><br></div><div>I'm not opposed to adding extra_shapes as a keyword argument to broadcast_arrays, but it seems unnecessarily complex, Implementation wise, I think it would actual make more sense to make broadcast_arrays depend on broadcast_to (e.g., by composing a function to calculate the broadcast shape with broadcast_to).</div><div><br></div><div>Stephan</div><div><br></div></div></div></div>