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

Error handling #63

Open
go-dockly opened this issue Dec 15, 2020 · 1 comment
Open

Error handling #63

go-dockly opened this issue Dec 15, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@go-dockly
Copy link

Hey Guys,
I saw that there are 227 uses of panic in 87 files and I do understand your motivation behind it.
Go's implicit error returns stand in the way of function chaining youd like to achieve
eg gx := r.x1.Value().(*mat.Dense).MulT(gy)
Let's assume MulT can panic inside the backward scope but that panic should recover in eg the graph wrapper scope
This should explain bit better what I mean
What are your thoughts on this?

@matteo-grella
Copy link
Member

I actually think there's a lot of room for improvement on that front! However, I wonder how to recover an error in case of a size mismatch, for example.

If I understand you correctly, you want to recover the panics generated inside the auto-grad functions (and in turn by mathematical functions) at the ag.Graph level.

Would you like to try to write some pseudo-code below for the solution you have in mind?

@matteo-grella matteo-grella added the enhancement New feature or request label Dec 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants