How to use the blis.py.einsum function in blis

To help you get started, we’ve selected a few blis examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github explosion / cython-blis / blis / benchmark.py View on Github external
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)

blis

The Blis BLAS-like linear algebra library, as a self-contained C-extension.

BSD-2-Clause
Latest version published 2 months ago

Package Health Score

87 / 100
Full package analysis