You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lux does have mechanisms to catch these. While not perfect, activating the following preferences will throw errors whenever a "bad" type is being propagated. I don't turn these on by default, since they can have some overhead but for testing purposes these should be set to "error" on CI.
using Preferences
Preferences.set_preferences!("Lux", "eltype_mismatch_handling"=>"error")
Preferences.set_preferences!("LuxLib", "instability_check"=>"error")
Preferences.set_preferences!("LuxCore", "instability_check"=>"error")
The text was updated successfully, but these errors were encountered:
Currently several places in the codebase uses this pattern:
But,
adapt
doesn't work with eltype, for example:This causes
adapt
to simply ignore the eltype and constructs non-concrete array types, which eventually leads to issues like https://github.com/SciML/NeuralPDE.jl/actions/runs/10485955321/job/29043160310?pr=882#step:6:1231 (matrix multiplication with non-concrete elements).Lux does have mechanisms to catch these. While not perfect, activating the following preferences will throw errors whenever a "bad" type is being propagated. I don't turn these on by default, since they can have some overhead but for testing purposes these should be set to "error" on CI.
The text was updated successfully, but these errors were encountered: