Skip to content

Matrix batching

Choose a tag to compare

@PMKielstra PMKielstra released this 29 Aug 22:47
· 4 commits to main since this release

It's been pointed out to me that

def A(x):
    return matrix @ x

is often more efficient than

def A(x):
    return einsum("ij,bj->bi", A, x)

and so PyConGrad now expects batched matrix right-hand sides, rather than batched vector right-hand sides. It is now the batched vector behavior that can be recovered with a custom backend.