return applyIndexMapping(tensor, new IndexMapper(_from, _to));
}
public static Tensor applyIndexMapping(Tensor tensor, IndexMapper mapper) {
TreeTraverseIterator iterator = new TreeTraverseIterator(tensor, TraverseGuide.EXCEPT_FUNCTIONS_AND_FIELDS);
TraverseState state;
SimpleIndices oldIndices, newIndices;
SimpleTensor simpleTensor;
while ((state = iterator.next()) != null) {
if (state == TraverseState.Leaving)
continue;