1

I am looking for a faster alternative for the following code.

rows = 30
cols = 10**3
v_mat = np.random.rand(rows,cols)
a_mat = np.random.rand(cols,cols)

b_vec = (v_mat @ a_mat @ v_mat.T).diagonal()

0 Answers0