IValue¶
-
public class
IValue
¶ Java representation of a TorchScript value, which is implemented as tagged union that can be one of the supported types: https://pytorch.org/docs/stable/jit.html#types .
Calling
toX
methods for inappropriate types will throwIllegalStateException
.IValue
objects are constructed withIValue.from(value)
,IValue.tupleFrom(value1, value2, ...)
,IValue.listFrom(value1, value2, ...)
, or one of thedict
methods, depending on the key type.Data is retrieved from
IValue
objects with thetoX()
methods. Note thatstr
-type IValues must be extracted withtoStr()
, rather thantoString()
.IValue
objects may retain references to objects passed into their constructors, and may return references to their internal state fromtoX()
.