func gradient(m, n, k int, mk, kn, dmk, dkn, dmn []float32) { for kk := 0; kk < k; kk++ { for mm := 0; mm < m; mm++ { var ( mk = mk[mm*k+kk] sum = float32(0) ) for nn := 0; nn < n; nn++ { var ( kn = kn[kk*n+nn] dmn = dmn[mm*n+nn] ) dmk[kk*n+nn] += mk * dmn sum += dmn * kn } dkn[mm*k+kk] += sum } } }
To receive a hint, submit unfixed code.