-
public final class EValueJava representation of an ExecuTorch value, which is implemented as tagged union that can be one of the supported types: https://pytorch.org/docs/stable/jit.html#types .
Calling
toXmethods for inappropriate types will throw IllegalStateException.EValueobjects are constructed withEValue.from(value), depending on the value type.Data is retrieved from
EValueobjects with thetoX()methods. Note thatstr-type EValues must be extracted with toStr, rather than toString.EValueobjects may retain references to objects passed into their constructors, and may return references to their internal state fromtoX().Warning: These APIs are experimental and subject to change without notice
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classEValue.Companion
-
Method Summary
Modifier and Type Method Description final BooleangetIsNone()final BooleangetIsTensor()final BooleangetIsBool()final BooleangetIsInt()final BooleangetIsDouble()final BooleangetIsString()final TensortoTensor()final BooleantoBool()final LongtoInt()final DoubletoDouble()final StringtoStr()final ByteArraytoByteArray()Serializes an EValueinto a byte array.-
-
Method Detail
-
getIsTensor
final Boolean getIsTensor()
-
getIsDouble
final Boolean getIsDouble()
-
getIsString
final Boolean getIsString()
-
toByteArray
final ByteArray toByteArray()
Serializes an
EValueinto a byte array. Note: This method is experimental and subject to change without notice.
-
-
-
-