Currently, permutedims!!(R::Tensor, T::Tensor, perm, f::Function) accepts only a 2-argument function that applies pairwise to the elements of R and permutedims(T, perm).
This could be replaced by a more general function map_permutedims!!(f::Function, R::Tensor, T1::Tensor, perm1, T2::Tensor, perm2, ...), where f is an n-argument function for inputs (T1, perm1, T2, perm2, ..., Tn, permn). This could act as a useful backend for more general ITensor broadcasting, and could directly be written in terms of Strided.jl broadcast calls like:
@strided R .= f.(permutedims(T1, perm1), permutedims(T2, perm2), ...)
Currently,
permutedims!!(R::Tensor, T::Tensor, perm, f::Function)
accepts only a 2-argument function that applies pairwise to the elements ofR
andpermutedims(T, perm)
.This could be replaced by a more general function
map_permutedims!!(f::Function, R::Tensor, T1::Tensor, perm1, T2::Tensor, perm2, ...)
, wheref
is an n-argument function for inputs(T1, perm1, T2, perm2, ..., Tn, permn)
. This could act as a useful backend for more general ITensor broadcasting, and could directly be written in terms of Strided.jl broadcast calls like: