doing length(p) fails when p is MTKParameters object and gives warnings like:
┌ Warning: The supplied DiffCache was too small and was enlarged. This incurs allocations
│ on the first call to `get_tmp`. If few calls to `get_tmp` occur and optimal performance is essential,
│ consider changing 'N'/chunk size of this DiffCache to 12.
└ @ PreallocationTools ~/.julia/packages/PreallocationTools/zJxgA/src/PreallocationTools.jl:191
It should be fixed by using the length of the tunable portion.
doing
length(p)
fails whenp
is MTKParameters object and gives warnings like:It should be fixed by using the length of the tunable portion.
will also fix https://github.com/SciML/ModelingToolkitNeuralNets.jl/issues/4