-
Notifications
You must be signed in to change notification settings - Fork 23
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
Release type constraints #34
Comments
String typying, i.e Concerning |
The usual way to handle this is to ensure that your functions preserve the types of the inputs, i.e. if a user passes in a This is a great write-up on why types in Julia should be used only for dispatch, not for constraining arguments.
I'm not thinking of a specific type here, but it's not uncommon for a user to implement and use some custom numeric type like those in Unitful.jl or to try differentiating something using
Great! |
Well that's not trivial when working with other packages and supporting multiple julia version. For example in Nw we understand that it may be a bit too strong and we will look into making it better but at the time, due to some dependencies and some older julia version support we had to go that way. I had a check for |
I didn't hit any errors from this, but I noticed a few while looking through the code. For example, this definition:
I understand that. Arbitrary type-promotion is a problem in Zygote. ChainRules v1 introduced machinery what would cause cotangents of |
This should be fixed after #37. For Float32, we will see when we can switch to more type stable layers but will have to stick to float32 for now. WE'll let you know when we made progress on that front. |
#34 should fix this issue, hope it helps. EDIT: once done with bug fixes |
@sethaxen should be all fixed now, hope it helps your software. |
Throughout the package, it seems numerical arguments are restricted to
Float32
. This prevents usage of the code with custom real numeric types. Can this constraint be relaxed to<:Real
, or even no constraint at all?Likewise, in a number of places array types are constraint to
Array
, so that the code cannot be used with custom array types. Can that likewise be relaxed? Fewer type constraints means greater potential for composeability with other packages.The text was updated successfully, but these errors were encountered: