Thanks and congrats to the team for the great work
I am wondering if the following behavior is the expected one. In Numpy, when we invert an F-order array, it will be c-contiguous, e.g.
a = np.asfortranarray(np.random.rand(3, 3))
print(f'{a.flags}\n{np.linalg.inv(a).flags}')
gives
C_CONTIGUOUS : False
F_CONTIGUOUS : True
OWNDATA : True
WRITEABLE : True
ALIGNED : True
WRITEBACKIFCOPY : False
UPDATEIFCOPY : False
C_CONTIGUOUS : True
F_CONTIGUOUS : False
OWNDATA : True
WRITEABLE : True
ALIGNED : True
WRITEBACKIFCOPY : False
UPDATEIFCOPY : False
So the returned array is c-contiguous. However, when we do the same inside a method compiled with Numba:
@njit
def foo(a):
return np.linalg.inv(a)
a = np.asfortranarray(np.random.rand(3, 3))
print(foo(a).flags)
it gives:
C_CONTIGUOUS : False
F_CONTIGUOUS : True
OWNDATA : False
WRITEABLE : True
ALIGNED : True
WRITEBACKIFCOPY : False
UPDATEIFCOPY : False
The array keeps being f-contiguous.
any help is highly appreciated!