Thanks Jim,
I think like we've discussed, I think we should be safe to implicitly cast the tensor based on the type of the variable receiving the value from the list (which would become a custom list, something already planned by this
PR), e.g.
public final class TensorList {
private List<Tensor> tensors;
...
public <T extends TType> T get(int index) {
return (T) tensors.get(index);
}
...
}
try (TensorList tensors = session.runner().fetch(arg1).fetch(arg2).run()) {
TInt64 arg1Tensor = tensors.get(0);
TFloat64 arg2Tensor = tensors.get(1);
}
Dean Thompson has already pointed out that in some cases that won't work, like this one here, but I think this should be very rare to do such thing and it won't block neither a user doing it (he could still cast it explicitly later and that would work).
- Karl