You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 10, 2024. It is now read-only.
By mistake, I added [Differentiable] to the squaresample but I didn't change TensorView to DiffTensorView.
The result was a square.fwd() that simply calculates square(). I was wondering if there is ever a valid use case for doing this, and if not, if perhaps the compiler could catch this mistake? Because otherwise, if I pass a single input and single output, also by mistake, then there are no errors, but the result is definitely not the forward gradient :)
So I was wondering if this user error could be caught? Perhaps it's also useful to add a fwd example to the docs to make it very clear that, just like bwd, it expects a pair?
Thanks!
bert
(Edit: rewrote for clarity)
The text was updated successfully, but these errors were encountered:
bprb
changed the title
No error, bad output, from broken fwd signature
Using [Differentiable] without DiffTensorView
Nov 15, 2023
This is unfortunately a tricky situation. Since we do want to allow regular TensorView types for passing non-differentiable data, it would be confusing to throw errors/warnings when using TensorView with a [Differentiable] function.
As you suggested, for now, we'll add an example with .fwd() to the documentation to make the interface clearer, i.e., .fwd() computes both the regular output & its derivative
Hi Sai, thank you for the quick reply! I see, this is a valid thing to do. We'll just have to be careful then :)
Thanks for taking the suggestion about the docs!
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hello!
By mistake, I added
[Differentiable]
to thesquare
sample but I didn't changeTensorView
toDiffTensorView
.The result was a
square.fwd()
that simply calculatessquare()
. I was wondering if there is ever a valid use case for doing this, and if not, if perhaps the compiler could catch this mistake? Because otherwise, if I pass a single input and single output, also by mistake, then there are no errors, but the result is definitely not the forward gradient :)In detail, this shader...
... compiles without error, but
fwd
is not the gradient:So in this python code,
forward
is the same as thesquared
numbers:Output:
Everything is fine with the correct signature in the shader...
... and called as ...
So I was wondering if this user error could be caught? Perhaps it's also useful to add a
fwd
example to the docs to make it very clear that, just likebwd
, it expects a pair?Thanks!
bert
(Edit: rewrote for clarity)
The text was updated successfully, but these errors were encountered: