# Sparse high dimensional array support einsum?

**URL:** <https://discourse.julialang.org/t/sparse-high-dimensional-array-support-einsum/47222>\
**Category:** Numerics\
**Tags:** question, package\
**Created:** [September 24, 2020, 5:34pm UTC](https://discourse.julialang.org/t/sparse-high-dimensional-array-support-einsum/47222 "2020-09-24T17:34:42Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![mcabbott](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mcabbott/32/6603_2.png) [@mcabbott](https://discourse.julialang.org/u/mcabbott)\
**Post date:** [September 24, 2020, 8:13pm UTC](https://discourse.julialang.org/t/sparse-high-dimensional-array-support-einsum/47222/6 "2020-09-24T20:13:29Z")

</div>

Do you mean that you sum over all indices except the first and last? `i` there looks like it runs from 1 to 10, not 100. (But something else could label which indices don’t get summed, the `n`th & `m`th.) You could write this, but there’s little to gain over writing the loops yourself:

```julia
julia> inds = rand(1:10, 333, 100); vals = randn(333);
julia> out = zeros(10,10);
julia> using Tullio

julia> @tullio out[inds[r,1], inds[r,100]] += vals[r]

```

---

_[View the full topic](https://discourse.julialang.org/t/sparse-high-dimensional-array-support-einsum/47222)._
