summaryrefslogtreecommitdiffstats
path: root/vespajlib
diff options
context:
space:
mode:
authorArne Juul <arnej@verizonmedia.com>2021-04-15 08:02:38 +0000
committerArne Juul <arnej@verizonmedia.com>2021-04-15 10:42:35 +0000
commitaebe857d5bf307597c601303810b089a44e57fd8 (patch)
tree7fb5a83878d3fb4f5fa032cb8281e6607c618ed8 /vespajlib
parent81fad70d16a8494ce0464af6ee4ba9c0e12f6a6e (diff)
funnel type resolving through outputType()
Diffstat (limited to 'vespajlib')
-rw-r--r--vespajlib/src/main/java/com/yahoo/tensor/functions/Map.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/vespajlib/src/main/java/com/yahoo/tensor/functions/Map.java b/vespajlib/src/main/java/com/yahoo/tensor/functions/Map.java
index 0ddf0bb4e63..5eef1d0bec4 100644
--- a/vespajlib/src/main/java/com/yahoo/tensor/functions/Map.java
+++ b/vespajlib/src/main/java/com/yahoo/tensor/functions/Map.java
@@ -53,14 +53,14 @@ public class Map<NAMETYPE extends Name> extends PrimitiveTensorFunction<NAMETYPE
@Override
public TensorType type(TypeContext<NAMETYPE> context) {
- return argument.type(context);
+ return outputType(argument.type(context));
}
@Override
public Tensor evaluate(EvaluationContext<NAMETYPE> context) {
- Tensor argument = argument().evaluate(context);
- Tensor.Builder builder = Tensor.Builder.of(argument.type());
- for (Iterator<Tensor.Cell> i = argument.cellIterator(); i.hasNext(); ) {
+ 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()));
}