# Batched matmul with einsum

**URL:** https://discourse.julialang.org/t/batched-matmul-with-einsum/115448
**Category:** New to Julia
**Created:** [June 11, 2024, 12:00am UTC](https://discourse.julialang.org/t/batched-matmul-with-einsum/115448 "2024-06-11T00:00:02Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [June 11, 2024, 12:15am UTC](https://discourse.julialang.org/t/batched-matmul-with-einsum/115448/2 "2024-06-11T00:15:34Z")

</div>

I’m not sure if this can be inferred, but on a separate note you’d probably be better off making `k,l` the trailing dimensions, since Julia is column-major (unlike numpy).

> [@smartalecH](#):
>
> so that this can work with a `B` of arbitrary dimensions.

One option might be to use `reshape` to re-interpret any number of trailing dimensions into a single dimension.

---

_[View the full topic](https://discourse.julialang.org/t/batched-matmul-with-einsum/115448)._
