How do you use Pytorch model's function to get output instead of model.forward() function #4338
Unanswered
deshwalmahesh
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Can you call the method in a forward function or wrap it with nn.Module and call it in forward? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
TL;DR: How can I use
model.whatever_function(input)
instead ofmodel.forward(input)
for theonnx / onnxruntime
?I use CLIP embedding to create embedding for my Image and texts as:
Code is from the official git merge
and it works fine giving me
[Batch, 1024]
tensors for both for the loaded model.Now I have quantized my model in
Onnx
as:and the model is saved.
When I test the model as :
It gives me a list of length 2, one for each image and text and the
result[0]
has shape of[Batch,2]
.Beta Was this translation helpful? Give feedback.
All reactions