Package com.gencior.triton.core
Class InferRequestedOutput
java.lang.Object
com.gencior.triton.core.InferRequestedOutput
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for constructingInferRequestedOutputinstances with optional parameters. -
Method Summary
Modifier and TypeMethodDescriptiongetName()Returns the output tensor name.Returns the optional parameters for this output.booleanReturns whether this output has any parameters set.static InferRequestedOutputCreates a requested output with just a name and no additional parameters.
-
Method Details
-
of
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
Returns the output tensor name.- Returns:
- the name
-
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:
trueif parameters are present
-