-
Notifications
You must be signed in to change notification settings - Fork 62
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
extern(::Casted) seems ill-defined. (Remove Casted?) #10
Comments
Mainly because I didn't know about |
What do you reckon is the best way forwards? I guess we could either:
Any preference / have I missed an obvious option @jrevels ? |
This would be preferable, if possible, though I'm not sure if FillArrays covers everything that
Example where frule(::typeof(BLAS.asum), x) = (BLAS.asum(x), Rule(Δx -> sum(cast(sign, x) * Δx)))
rrule(::typeof(BLAS.asum), x) = (BLAS.asum(x), Rule(ΔΩ -> ΔΩ * cast(sign, x))) Even if FillArrays doesn't support this particular use case, it'd be great to stop punning on |
Hmm yeah, this is interesting. Your above examples definitely aren't something that you could straightforwardly re-implement using |
From #18 CastedIt is kind of the generalization of One, and Zero. So we can just get ride of it for now. |
extern(cast(1))
returns1
. This is unfortunate behaviour as we loose all of the e.g. size information that (arguably) should be associated with the casted thing. For example therrule
forsum
currently returns a casted1
to represent an array of ones, which would have been the same size as the input. Consequently, without reference to the input you don't know what the appropriate size is for a particularCasted
object.Is there a particular reason that this route has been taken as opposed to, say, returning
AbstractFill
s (fromFillArrays.jl
) which would be just as efficient in all cases that I can think of.The text was updated successfully, but these errors were encountered: