Closed ngphuoc closed 5 years ago
I'd like to adapt the data to a matching type. I try the following but it doesn't work. It seems Adapt is designed only for type?
using Adapt struct A a end x = [[[A(1), A("a")]]] adapt("to", x) adapt_storage(to, x::A) = A(to) adapt("to", x) Adapt.adapt_structure(to, x::A) = A(to) adapt("to", x) output: [[[A(1), A("a")]]]
Just realize my need is not suitable for Adapt!
I'd like to adapt the data to a matching type. I try the following but it doesn't work. It seems Adapt is designed only for type?