djl icon indicating copy to clipboard operation
djl copied to clipboard

pytorch and djl

Open yufengsjtu opened this issue 2 years ago • 1 comments

if the return value of forwards function in pytorch is a tuple of some tensors with different dimensions,what should i do to deal with such a problem in DJL lib in java

yufengsjtu avatar Feb 12 '23 14:02 yufengsjtu

@yufengsjtu

If the output is complicated data type that DJL is not able to automatically map it to NDList, you have to use IValue directly. see: https://github.com/deepjavalibrary/djl/blob/master/engines/pytorch/pytorch-engine/src/test/java/ai/djl/pytorch/integration/IValueTest.java#L201

frankfliu avatar Feb 12 '23 17:02 frankfliu