def rot90(W): for i in range(W.shape[0]): for j in range(W.shape[1]): W[i, j] = np.rot90(W[i, j], 2) return W