@Override
    public Tensor evaluate(EvaluationContext<NAMETYPE> context) {
        Tensor input = argument().evaluate(context);
        Tensor.Builder builder = Tensor.Builder.of(outputType(input.type()));
        for (Iterator<Tensor.Cell> i = input.cellIterator(); i.hasNext(); ) {
            java.util.Map.Entry<TensorAddress, Double> cell = i.next();
            builder.cell(cell.getKey(), mapper.applyAsDouble(cell.getValue()));
        }
        return builder.build();
    }
The <i>map</i> tensor function produces a tensor where the given function is applied on each cell value.

@author bratseth
vespajlib/src/main/java/com/yahoo/tensor/functions/Map.java