Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make compact macro report call site lines stacktraces #1216

Open
oxinabox opened this issue Jan 20, 2025 · 0 comments
Open

Make compact macro report call site lines stacktraces #1216

oxinabox opened this issue Jan 20, 2025 · 0 comments

Comments

@oxinabox
Copy link
Contributor

Right now, if there is a exception thrown in code that uses @compact to declare the custom layer,
the stack trace just reports a line in

  [8] (::Lux.CompactLuxLayer{…})(x::Tuple{…}, ps::@NamedTuple{…}, st::@NamedTuple{…})
    @ Lux ~/.julia/packages/Lux/Zukby/src/helpers/compact.jl:364

It would be much more useful if it reported which line in the user code caused the error.

There are various methods that can be used for this.
Though none nicely documented.
Basically need to filter the wrong info out of the line number nodes in the AST, and insert the __source__

Examples:

I am note sure if these suffice for something that is multiline
but we have the tech to do at least a little better than we do now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant