Package com.gencior.triton.core.pojo
Class TritonTensorMetadata
java.lang.Object
com.gencior.triton.core.pojo.TritonTensorMetadata
Encapsulates metadata information about a single tensor in a model's input or output.
This class describes the schema of a tensor including its name, data type, and shape. This information is essential for correctly formatting data before sending it to Triton or interpreting data returned from Triton.
This is an immutable object that wraps the gRPC message ModelMetadataResponse.TensorMetadata.
- Since:
- 1.0.0
- Author:
- sachachoumiloff
-
Method Summary
Modifier and TypeMethodDescriptionstatic TritonTensorMetadataReturns the data type of the tensor elements.getName()Returns the name of the tensor.getShape()Returns an unmodifiable list representing the shape of the tensor.toString()
-
Method Details
-
fromProto
public static TritonTensorMetadata fromProto(GrpcService.ModelMetadataResponse.TensorMetadata proto) -
getName
Returns the name of the tensor.- Returns:
- the tensor name
-
getDatatype
Returns the data type of the tensor elements.Examples: "FP32", "INT64", "BYTES", etc.
- Returns:
- the data type as a string
-
getShape
Returns an unmodifiable list representing the shape of the tensor.For example, a 3D image might have shape [1, 224, 224]. A dimension value of -1 indicates a variable-sized dimension.
The returned list is immutable and cannot be modified.
- Returns:
- an immutable list of dimension sizes
-
toString
-