def permuted
import bendtorch@1.3.0.0/tensor.bend as Tensorimport Base
467# the shape with axes reordered by p: axis d of the result is axis p[d] of s
468def permuted(+s: List<&2, Nat>, p: List<&2, Nat>) -> List<&2, Nat>:
469 match p:
470 case Nil{}:
471 Nil{}
472 case Con{k, r}:
473 at1(s, k) <> permuted(s, r)