-
Hi, I would like to convert a The following code describes my idea:
The code actually runs, but each time the method is invoked, PS: I 'm using the I would like to know if there is any way to invoke a PyTorch function in a plugin using data with variable lengths. Thank you in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi @gerwang There are some limitations to using DrJit is a just-in-time compiler and records the computation rather than executing it sequentially. Especially for virtual function calls there is an important recording mechanism. In your example, The recorded computation is only evaluated once it needs to be used by some function outside of Dr.Jit/Mitsuba as this function would not know what to do with DrJit's recorded computation graph. Unfortunately, it is not possible to evaluate a variable everywhere, namely virtual function calls are restricted. Calling I am surprised you didn't get an error/warnming message regarding this. Were you just calling Instead of |
Beta Was this translation helpful? Give feedback.
Hi @gerwang
There are some limitations to using
wrap_ad
inside of plugins. Please refer to Dr.Jit's documentation first, to roughly understand how it works.DrJit is a just-in-time compiler and records the computation rather than executing it sequentially. Especially for virtual function calls there is an important recording mechanism. In your example,
eval
will be some target of a virtual function call in your integrator. In fact, there might be thousands of emitters in your scene and we need to record every possibility.The recorded computation is only evaluated once it needs to be used by some function outside of Dr.Jit/Mitsuba as this function would not know what to do with DrJit's re…