Class InferRequestedOutput

java.lang.Object
com.gencior.triton.core.InferRequestedOutput

public final class InferRequestedOutput extends Object
Specifies an output tensor to be returned from an inference request.

By default, Triton returns all outputs defined in a model's configuration. Use this class to request only specific outputs, reducing network bandwidth and memory usage — especially useful for models with many output tensors where only a subset is needed.

Usage — Simple (name only):


 InferResult result = client.infer("bert", inputs,
     List.of(InferRequestedOutput.of("embeddings")));
 // Only "embeddings" is returned, other outputs are skipped
 

Usage — With parameters:


 InferRequestedOutput output = new InferRequestedOutput.Builder("classification")
     .addParameter("classification", 3L) // top-3 classes
     .build();
 InferResult result = client.infer("classifier", inputs, List.of(output));
 
Since:
1.0.0
Author:
sachachoumiloff
  • Method Details

    • of

      public static InferRequestedOutput of(String name)
      Creates a requested output with just a name and no additional parameters.
      Parameters:
      name - the output tensor name (must match the model's output name)
      Returns:
      a new InferRequestedOutput
    • getName

      public String getName()
      Returns the output tensor name.
      Returns:
      the name
    • getParameters

      public Map<String,Object> getParameters()
      Returns the optional parameters for this output.
      Returns:
      an unmodifiable map of parameters (may be empty)
    • hasParameters

      public boolean hasParameters()
      Returns whether this output has any parameters set.
      Returns:
      true if parameters are present