All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ai.vespa.rankingexpression.importer.operations.Merge Maven / Gradle / Ivy

// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package ai.vespa.rankingexpression.importer.operations;

import ai.vespa.rankingexpression.importer.OrderedTensorType;
import com.yahoo.searchlib.rankingexpression.Reference;
import com.yahoo.tensor.functions.TensorFunction;

import java.util.List;

public class Merge extends IntermediateOperation {

    public Merge(String modelName, String nodeName, List inputs) {
        super(modelName, nodeName, inputs);
    }

    @Override
    protected OrderedTensorType lazyGetType() {
        for (IntermediateOperation operation : inputs) {
            if (operation.type().isPresent()) {
                return operation.type().get();
            }
        }
        return null;
    }

    @Override
    protected TensorFunction lazyGetFunction() {
        for (IntermediateOperation operation : inputs) {
            if (operation.function().isPresent()) {
                return operation.function().get();
            }
        }
        return null;
    }

    @Override
    public Merge withInputs(List inputs) {
        return new Merge(modelName(), name(), inputs);
    }

    @Override
    public String operationName() { return "Merge"; }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy