Skip to content

Use scalar instead of Tensor in inference #2423

Answered by frankfliu
Baerlie asked this question in Q&A
Discussion options

You must be logged in to vote

@Baerlie

PyTorch use IValue in its c++ API, we can automatically map NDList to IValue for Tensors (List, Map, tuple of Tensors). For non-tensor data or other complicate data type, you have to use IValue directly: https://github.com/deepjavalibrary/djl/blob/master/engines/pytorch/pytorch-engine/src/test/java/ai/djl/pytorch/integration/IValueTest.java#L201

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@Baerlie
Comment options

Answer selected by Baerlie
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants