Class TritonTensorMetadata

java.lang.Object
com.gencior.triton.core.pojo.TritonTensorMetadata

public final class TritonTensorMetadata extends Object
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 Details

    • fromProto

    • getName

      public String getName()
      Returns the name of the tensor.
      Returns:
      the tensor name
    • getDatatype

      public String getDatatype()
      Returns the data type of the tensor elements.

      Examples: "FP32", "INT64", "BYTES", etc.

      Returns:
      the data type as a string
    • getShape

      public List<Long> 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

      public String toString()
      Overrides:
      toString in class Object