-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Unify reshape routing to make extension easier #39123
Comments
This is actually something I've wanted to do for a long time. It's a bit of a rats nest right now, and IIRC there are two levels of redirection — one for colons and one for axes/offset arrays. It's the latter that poses the bigger problem. |
I assume the second level is this? So would you want to lift that logic out of an internal function? |
Yes, I'd think so. But it's a general problem with Offset arrays — general array types want the "extension" method to be the simple |
Okay I see why there was this extra path now. There's a dispatch ambiguity if you redefine it like I want mentioned above. Maybe we can just tweak |
It looks like there was already a fix for the initial complaint. I can still keep this issue open since we still want to clean up the interface. |
We ran into an issue trying to extend
Base.reshape
in FluxML/Flux.jl#1448. Ideally, someone should only have to overloadto get insert their custom behavior. Currently, calls involving a single
:
bypass this method signature directly to the internal_reshape
. I'd like to redefine this line to be:so that it routes through the signature above after the uncolon logic is applied. I see no real problems with this, but I wanted to create an issue before a PR to get told why I'm wrong.
The text was updated successfully, but these errors were encountered: