Open ricardoV94 opened 4 months ago
hello! i'll take up this issue. i understand the issue and also saw the main issue on pymc. how should i start solving this?
You should tweak this base case NotImplementedError, to include self
in the message: https://github.com/pymc-devs/pytensor/blob/090b844ece5412535ab3d030c5bfc2d168aba2ef/pytensor/graph/op.py#L360
Im trying to use the grad_not_implemented
function but im slightly confused about the implementation.
what is the inputs
parameter to the grad function so that i can use it while passing to the grad_not_implemented
as used in some other places.
i made some commits to my fork but they arent showing up in this issue for u to review? :confused:
You need to open a pull request from your fork: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork
Description
When grad fails because a specific Op doesn't support it it's quite difficult to figure out which one it was without jumping on an interactive debugger
https://discourse.pymc.io/t/avoiding-non-nuts-samplers-when-broadcasting-a-multiplication-operation/14245/4?u=ricardov94
We should return something like
NotImplementedError(f"grad not implemented for Op {self}")
in a base class.Or use the
grad_not_implemented
functionality that exists for partial grad implementations which also provides a more readable error IIRC