The Tens-Or-Slice™ is a little gadget which aims to make all kinds of slicing, dicing, squeezing and splicing look easy on TV. For example, this is how you slice a 3-tensor into 3×3 SMatrix pieces

```
@shape B[k]{i,j} == A[i,j,k] i:3, j:3
```

And this glues them together again, using `reduce(cat,...)`

as if they were ordinary matrices, and then reshapes & transposes to get an N×3 matrix:

```
@shape C[(j,k),i] := B[k][i,j]
```

This macro doesn’t really do any of the work, it just calls standard Julia things, and can be hooked up to StaticArrays.jl,JuliennedArrays.jl, and Strided.jl. The notation is supposed to agree with `@tensor`

and `@einsum`

(they overlap on `permutedims`

) with the addition of `==`

to mean a view rather than `:=`

which is a copy.

This was basically a holiday project (once the advent-of-code puzzles got too long) to teach myself a little macrology, which suffered from a little scope creep. But perhaps it will be useful to some of you.

It’s not registered, as there are probably still a few bugs to catch — awkward test cases would be welcome. Installation:

```
] add https://github.com/mcabbott/TensorSlice.jl
```