//TODO Indices -> int[]
private Tensor transform(Tensor tensor, IndexGenerator indexGenerator, Indices ind) {
if (tensor instanceof SimpleTensor) {
if (!indicator.is(tensor))
return tensor.clone();
IndicesBuilderSimple ib = new IndicesBuilderSimple();
ib.append(tensor.getIndices()).append(ind);
return CC.createSimpleTensor(
CC.getNameDescriptor(((SimpleTensor) tensor).getName()).getName(), (SimpleIndices) ib.getIndices());
} else if (tensor instanceof Sum) {
Sum newSum = new Sum();
IndexGeneratorWrapper wrapper = new IndexGeneratorWrapper(indexGenerator);
for (Tensor t : tensor) {
//TODO review !!!!!!!!!!!!