ChainRules.jl
ChainRules.jl copied to clipboard
BLAS.gemm and BLAS.gemv pullbacks are type-unstable
As identified by https://github.com/JuliaDiff/ChainRulesTestUtils.jl/pull/78, the pullbacks for BLAS.gemm and BLAS.gemv are type-unstable because a different InplaceableThunk is returned based on the value of the input parameters. For the norm functions, I worked around this by pushing the condition check to within the thunk, which in this case looks like it will produce a lot of duplicate code. Do we expect that this type-instability to cause decreased efficiency?