Class OnnxTensorLike

java.lang.Object
ai.onnxruntime.OnnxTensorLike
All Implemented Interfaces:
OnnxValue, AutoCloseable
Direct Known Subclasses:
OnnxSparseTensor, OnnxTensor

public abstract class OnnxTensorLike extends Object implements OnnxValue
Currently implemented by OnnxTensor, OnnxSparseTensor. Will be sealed to these types one day.
  • Field Details

    • nativeHandle

      protected final long nativeHandle
      The native pointer.
    • allocatorHandle

      protected final long allocatorHandle
      The pointer to the native memory allocator.
    • info

      protected final TensorInfo info
      The size and shape information for this tensor.
    • closed

      protected boolean closed
      Is this value closed?
  • Method Details

    • getInfo

      public TensorInfo getInfo()
      Returns a TensorInfo for this tensor.
      Specified by:
      getInfo in interface OnnxValue
      Returns:
      The tensor info.
    • isClosed

      public boolean isClosed()
      Description copied from interface: OnnxValue
      Checks if this value is closed (i.e., the native object has been released).
      Specified by:
      isClosed in interface OnnxValue
      Returns:
      True if the value is closed and the native object has been released.
    • checkClosed

      protected void checkClosed()
      Checks if the OnnxValue is closed, if so throws IllegalStateException.