<p>Hi,</p>
<p>I just noticed a document/ implementation conflict with tril and triu. <br>According tril documentation it should return of same shape and data-type as <br>called. But this is not the case at least with dtype bool.</p>

<p>The input shape is referred as (M, N) in tril and triu, but as (N, M) in tri. <br>Inconsistent?</p>
<p>Also I'm not very happy with the performance, at least dtype bool can be <br>accelerated as follows.</p>
<p>In []: M= ones((2000, 3000), dtype= bool)<br>In []: timeit triu(M)<br>10 loops, best of 3: 173 ms per loop<br>In []: timeit triu_(M)<br>10 loops, best of 3: 107 ms per loop</p>
<p>In []: M= asarray(M, dtype= int)<br>In []: timeit triu(M)<br>10 loops, best of 3: 160 ms per loop<br>In []: timeit triu_(M)<br>10 loops, best of 3: 163 ms per loop</p>
<p>In []: M= asarray(M, dtype= float)<br>In []: timeit triu(M)<br>10 loops, best of 3: 195 ms per loop<br>In []: timeit triu_(M)<br>10 loops, best of 3: 157 ms per loop</p>
<p>I have attached a crude 'fix' incase someone is interested.</p>
<div>Regards,</div>
<div>eat</div>