[pythran] Re: ND arrays

  • From: serge guelton <serge.guelton@xxxxxxxxxxxxxxxxxxx>
  • To: pythran@xxxxxxxxxxxxx
  • Date: Mon, 26 Nov 2018 22:53:41 +0100

On Mon, Nov 26, 2018 at 03:32:13PM -0500, Neal Becker wrote:

I have an algorithm that accepts ND arrays.  I suppose pythran cannot
accelerate ND algorithms, only for known number of dimensions, correct?

Correct. The number of dimension is fixed, but you can instanciate your 
function for different size:


.. code:: python

    #pythran export foo(float64)
    #pythran export foo(float64[:])
    #pythran export foo(float64[:,:])
    #pythran export foo(float64[:,:,:])

    def foo(x):
        return x *3.5 + 4.7

Other related posts: