Skip to content

Include Op in message when raising NotImplementedError from grad  #711

Closed
@ricardoV94

Description

@ricardoV94

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions