公用類別 CastOp
將 TensorBuffer 轉換為指定的資料類型。
公用建構函式
公用方法
| TensorBuffer |
apply(TensorBuffer 輸入)
|
繼承的方法
公用建構函式
public CastOp (DataType destinationType)
建構 CastOp。
注意:如要立即針對特定 TensorBuffer (而非在處理器中) 進行轉換類型,請直接使用 TensorBuffer.createFrom(TensorBuffer, DataType)。
執行此運算時,如果原始的 TensorBuffer 已在 destinationType 中,系統會直接傳回原始緩衝區。
參數
| destinationType | 要投放的 TensorBuffer 類型。 |
|---|
擲回
| IllegalArgumentException | 表示 destinationType 不是 DataType.UINT8 和 DataType.FLOAT32。 |
|---|