Open denizyuret opened 8 years ago
Thanks Tim, the following three lines solved the problem:
type _CudaArraySave; a::Array; end
JLD.writeas(c::CudaArray) = _CudaArraySave(to_host(c))
JLD.readas(d::_CudaArraySave) = CudaArray(d.a)
Do you want to put this in CUDArt? I was going to submit a pull request but I couldn't be sure if you wanted JLD to be a requirement for CUDArt. In either case, this issue can be closed.
If you can come up with a solution that exploits Requires.jl, do you think that would be better?
I'd like to fix this so people can save and load machine learning models that use CudaArray's without having to explicitly copy everything to cpu. Is the right way to overwrite serialize - deserialize? Or is it to introduce a new cpu array type that CudaArrays know to convert themselves to and from during load/save? Or is there some other way?