I have cythonized the following file that uses numpy's matrix multiplication:
def cell(float[:, ::1] a, float[:, ::1] b):
c = a @ b
return c
However, when I call it with:
from matmul import cell
import numpy as np
a = np.zeros((1, 64), dtype=np.float32)
b = np.zeros((64, 64), dtype=np.float32)
c = cell(a, b)
I get the following error:
TypeError: unsupported operand type(s) for @: _memoryviewslice and _memoryviewslice
How can I perform matrix multiplication with Cython?
Context: the function "cell" is part of a code I wrote that performs a prediction by an LSTM network (I wrote it manually, without using PyTorch or Tensorflow, just NumPy). I need to speed up the code to be able to use the network in real-time.