Since I wrote this, I have figured out a better way to do this anyway, how about

    from numpy cimport ndarray as ar
    ...
    cdef ar[double,ndim=2] X = ...