JuliaDiff / DiffRules.jl

A simple shared suite of common derivative definitions
Other
75 stars 38 forks source link

Avoid inv() in / and \ #46

Closed haampie closed 4 years ago

haampie commented 4 years ago

This solves a common issue where taking the derivative of f(x::Float32, y::Int) = x / y with respect to x accidentally promotes the number type from Float32 to Float64.

This issue is rather unexpected and hard to discover in Flux.

Ref: