Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
bratseth committed Oct 4, 2024
1 parent c7a6e1d commit 450a466
Showing 1 changed file with 2 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -12,17 +10,15 @@
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
*/
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;

/**
Expand All @@ -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> tensor = ((TensorFieldValue)context.getValue()).getTensor();
Expand Down

0 comments on commit 450a466

Please sign in to comment.