<div dir="ltr">I'm trying to do it, but each time I want to test something, it takes a long time to rebuild numpy to test it. Is there a way to don't recompile everything for each test?<br><br>thanks<br><br>Fred<br>

</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 10, 2013 at 1:34 PM, Charles R Harris <span dir="ltr"><<a href="mailto:charlesr.harris@gmail.com" target="_blank">charlesr.harris@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br><br><div class="gmail_quote"><div><div class="h5">On Fri, May 10, 2013 at 10:08 AM, Frédéric Bastien <span dir="ltr"><<a href="mailto:nouiz@nouiz.org" target="_blank">nouiz@nouiz.org</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div><div>Hi,<br><br></div><div>it popped again on the Theano mailing list that this don't work:<br><br></div><div>np.arange(10) <= a_theano_vector.<br><br></div><div>

The reason is that __array_priority__ isn't respected for that class of operation.<br></div><br></div><div>This page explain the problem and give a work around:<br></div><div><div><br><a href="http://stackoverflow.com/questions/14619449/how-can-i-override-comparisons-between-numpys-ndarray-and-my-type" target="_blank">http://stackoverflow.com/questions/14619449/how-can-i-override-comparisons-between-numpys-ndarray-and-my-type</a><br>




<br></div><div>The work around is to make a python function that will decide witch version of the comparator to call and do the call. Then we tell NumPy to use that function instead of its current function with: np.set_numeric_ops(...)<br>




<br>But<span name="John Salvatier"> if we do that, when we import theano, we will slow down all normal numpy comparison for the user, as when <= is execute, first there will be numpy c code executed, that will call the python function to decide witch version to do, then if it is 2 numpy ndarray, it will call again numpy c code.<br>




<br></span></div><div><span name="John Salvatier">That isn't a good solution. We could do the same override in C, but then theano work the same when there isn't a c++ compiler. That isn't nice.<br>

<br></span></div><div><span name="John Salvatier">What do you think of changing them to check for __array_priority__ before doing the comparison?</span></div></div></div></blockquote></div></div><div><br>This looks like an oversight and should be fixed.<br>


<br>Chuck <br></div></div>
<br>_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@scipy.org">NumPy-Discussion@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/numpy-discussion" target="_blank">http://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
<br></blockquote></div><br></div>