use of com.yahoo.searchlib.rankingexpression.rule.ConstantNode in project vespa by vespa-engine.
the class ExpandDims method lazyGetFunction.
@Override
protected TensorFunction lazyGetFunction() {
if (!allInputFunctionsPresent(2)) {
return null;
}
// multiply with a generated tensor created from the reduced dimensions
TensorType.Builder typeBuilder = new TensorType.Builder();
for (String name : expandDimensions) {
typeBuilder.indexed(name, 1);
}
TensorType generatedType = typeBuilder.build();
ExpressionNode generatedExpression = new ConstantNode(new DoubleValue(1));
Generate generatedFunction = new Generate(generatedType, new GeneratorLambdaFunctionNode(generatedType, generatedExpression).asLongListToDoubleOperator());
return new com.yahoo.tensor.functions.Join(inputs().get(0).function().get(), generatedFunction, ScalarFunctions.multiply());
}
Aggregations