Remove convert type piracy from Reactant extension#5713
Conversation
|
Huh yeah these are bad we should remove |
|
Looks like tests are failing on an attempt to call |
|
That's coming from Oceananigans.jl/src/TimeSteppers/clock.jl Lines 184 to 188 in 2f1e829 |
|
So perhaps we need a different |
|
who is calling Float(TracedRFloat) because that's definitely invalid |
|
|
oh sorry missed that |
|
Should we just use a different function which isn't |
|
sorry yes this is my fault! could we regress to the initial clock soln, storing kernel time as three separate args? Unless there is another way to demote that doesn't involve calling |
This allows us to adapt `Clock`'s internal fields, without doing type piracy.
What if we use Reactant.TracedRNumber{Float64} for the "kernel time type" ? |
|
Am I good to go with the current implementation? It does address the piracy issue, and it's minimally invasive, it doesn't change any data structure. Things like changing the kernel type may be done in follow up PRs, if that's a viable option. |
yes, this is acceptable to me |
Currently we have
These methods are type piracy (behaviour of Reactant changes after you load Oceananigans) and not a good idea anyway (
convert(T, x)should return an instance ofT, otherwise why callingconvertin the first place).Ref: #5570 (comment).