類 OnnxSequence

  • 所有已實現的介面
    OnnxValue, java.lang.AutoCloseable

    public class OnnxSequence
    extends java.lang.Object
    implements OnnxValue
    一個由型別相同的 OnnxValue 組成的序列。

    支援 "onnxruntime_c_api.h" 中提到的型別,目前有

    • OnnxTensor<String>
    • OnnxTensor<Long>
    • OnnxTensor<Float>
    • OnnxTensor<Double>
    • OnnxMap<String,Float>
    • OnnxMap<Long,Float>
    • 方法摘要

      所有方法 例項方法 具體方法 
      修飾符和型別 方法 描述
      protected void checkClosed()
      檢查 OnnxValue 是否已關閉,如果是則丟擲 IllegalStateException
      void close()
      關閉此序列,釋放其底層本地記憶體及其元素。
      SequenceInfo getInfo()
      獲取與此 OnnxValue 關聯的型別資訊物件。
      OnnxValue.OnnxValueType getType()
      獲取此 OnnxValue 的型別。
      java.util.List<? extends OnnxValue> getValue()
      提取一個由 OnnxValue 組成的 Java 列表,這些 OnnxValue 可以進一步解包。
      boolean isClosed()
      檢查此值是否已關閉(即本地物件已釋放)。
      java.lang.String toString()  
      • 從類 java.lang.Object 繼承的方法

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • 方法詳細資訊

      • getValue

        public java.util.List<? extends OnnxValue> getValue()
                                                     throws OrtException
        提取一個由 OnnxValue 組成的 Java 列表,這些 OnnxValue 可以進一步解包。

        返回一個由 OnnxTensorOnnxMap 組成的 List

        注意,與其他的 OnnxValue.getValue() 方法不同,此方法不會將值本身複製到 Java 堆中,它僅將其公開為 OnnxValue 例項,允許使用者使用 OnnxTensor 可用的更快的複製方法。這也意味著這些值需要與此例項分開關閉,並且不會透過此物件的 close() 方法關閉。

        指定者
        getValue 在介面 OnnxValue 中指定
        返回
        一個包含這些值的 Java 列表。
        丟擲
        OrtException - 如果執行時未能讀取元素。
      • getInfo

        public SequenceInfo getInfo()
        描述複製自介面: OnnxValue
        獲取與此 OnnxValue 關聯的型別資訊物件。
        指定者
        getInfo 在介面 OnnxValue 中指定
        返回
        型別資訊。
      • toString

        public java.lang.String toString()
        覆蓋
        toString 在類 java.lang.Object
      • isClosed

        public boolean isClosed()
        描述複製自介面: OnnxValue
        檢查此值是否已關閉(即本地物件已釋放)。
        指定者
        isClosed 在介面 OnnxValue 中指定
        返回
        如果值已關閉且本地物件已釋放,則為 true。
      • close

        public void close()
        關閉此序列,釋放其底層本地記憶體及其元素。
        指定者
        close 在介面 java.lang.AutoCloseable
        指定者
        close 在介面 OnnxValue 中指定
      • checkClosed

        protected void checkClosed()
        檢查 OnnxValue 是否已關閉,如果是則丟擲 IllegalStateException