We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 63017e4 commit f31bccaCopy full SHA for f31bcca
extension/android/src/main/java/org/pytorch/executorch/EValue.java
@@ -61,7 +61,7 @@ public class EValue {
61
"ListInt",
62
"ListTensor",
63
"ListScalar",
64
- "ListOptionalScalar",
+ "ListOptionalTensor",
65
};
66
67
@DoNotStrip private final int mTypeCode;
@@ -267,6 +267,12 @@ public Tensor[] toTensorList() {
267
return (Tensor[]) mData;
268
}
269
270
+ @DoNotStrip
271
+ public Optional<Tensor>[] toOptionalTensorList() {
272
+ preconditionType(TYPE_CODE_LIST_OPTIONAL_TENSOR, mTypeCode);
273
+ return (Optional<Tensor>[]) mData;
274
+ }
275
+
276
private void preconditionType(int typeCodeExpected, int typeCode) {
277
if (typeCode != typeCodeExpected) {
278
throw new IllegalStateException(
0 commit comments