JuliaGPU / Adapt.jl

Other
86 stars 24 forks source link

simplify code for adapting (Named)Tuples and fix adapting NamedTuple() #20

Closed marius311 closed 4 years ago

marius311 commented 4 years ago

I simplified the code for adapting Tuples and NamedTuples without breaking any of the tests (I'm not seeing any other obvious impact on inferability or allocations). I also fixed the fact that previously adapt(NamedTuple()) was returning Tuple() instead of NamedTuple() (and added a test for this).

MikeInnes commented 4 years ago

Seems reasonable to me. Not sure who wrote this code but @maleadt might want to check it looks ok.

maleadt commented 4 years ago

Sorry, forgot about this. LGTM!

marius311 commented 4 years ago

I know its not much, but any chance of a release including this fix? The adapt(NamedTuple()) bug causes me to need to be on master of this package and makes reproducing the necessary environment harder.

maleadt commented 4 years ago

Sure!