private static void addInputToBuilder(List<GrpcService.ModelMetadataResponse.TensorMetadata> onnxInputTypes,
                                          GrpcService.ModelInferRequest.Builder builder,
                                          Tensor vespaTensor,
                                          String vespaName) {
        if (!(vespaTensor instanceof IndexedTensor indexedTensor)) {
            throw new TritonException("Nvidia Triton currently only supports tensors with indexed dimensions");
        }
        var onnxInput = findMatchingInput(onnxInputTypes, vespaName);
        var inputBuilder = GrpcService.ModelInferRequest.InferInputTensor.newBuilder()
                .setName(onnxInput.getName())
                .setDatatype(onnxInput.getDatatype());
        for (long dim : indexedTensor.shape()) {
            inputBuilder.addShape(dim);
        }
        builder.addInputs(inputBuilder.build());
        builder.addRawInputContents(createRawInputContent(onnxInput, indexedTensor));
    }
Experimental model inference using Nvidia Triton as ONNX backend.

@author bjorncs
model-integration/src/main/java/ai/vespa/triton/TritonOnnxClient.java