From 450a46693f35a6010c805ebb6ebb77f72260cd29 Mon Sep 17 00:00:00 2001 From: Jon Bratseth Date: Fri, 4 Oct 2024 15:25:04 +0200 Subject: [PATCH] Cleanup --- .../expressions/BinarizeExpression.java | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/indexinglanguage/src/main/java/com/yahoo/vespa/indexinglanguage/expressions/BinarizeExpression.java b/indexinglanguage/src/main/java/com/yahoo/vespa/indexinglanguage/expressions/BinarizeExpression.java index 44c1c8215103..491860cd788e 100644 --- a/indexinglanguage/src/main/java/com/yahoo/vespa/indexinglanguage/expressions/BinarizeExpression.java +++ b/indexinglanguage/src/main/java/com/yahoo/vespa/indexinglanguage/expressions/BinarizeExpression.java @@ -2,8 +2,6 @@ package com.yahoo.vespa.indexinglanguage.expressions; import com.yahoo.document.DataType; -import com.yahoo.document.DocumentType; -import com.yahoo.document.Field; import com.yahoo.document.TensorDataType; import com.yahoo.document.datatypes.TensorFieldValue; import com.yahoo.tensor.Tensor; @@ -12,7 +10,7 @@ import java.util.Optional; /** - * Converts a vector of any input type into a binarized vector. + * Converts a tensor of any input type into a binarized tensor: Each value is replaced by either 0 or 1. * * @author bratseth */ @@ -20,9 +18,7 @@ public class BinarizeExpression extends Expression { private final double threshold; - //private DataType targetType; - - /** The type this bth consumes and produces. */ + /** The type this consumes and produces. */ private DataType type; /** @@ -35,14 +31,6 @@ public BinarizeExpression(double threshold) { this.threshold = threshold; } - @Override - public void setStatementOutput(DocumentType documentType, Field field) { -// if (! (field.getDataType() instanceof TensorDataType)) -// throw new IllegalArgumentException("The 'binarize' function requires that the output type is a tensor, " + -// "but it is " + field.getDataType()); -// targetType = field.getDataType(); - } - @Override protected void doExecute(ExecutionContext context) { Optional tensor = ((TensorFieldValue)context.getValue()).getTensor();