Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def blis_einsum(X, W, n=1000):
nO, nI = W.shape
batch_size = X.shape[0]
total = 0.0
y = numpy.zeros((nO, batch_size), dtype="f")
for i in range(n):
einsum("ab,cb->ca", X, W, out=y)
total += y.sum()
y.fill(0.0)
print("Total:", total)