The "dask" serialization protocol has trouble preserving types. The following snippet uses the Pennylane package:
from dask.distributed.protocol import serialize, deserialize
import pennylane as qml
import pennylane.numpy as np
res = qml.numpy.random.uniform(0,2*np.pi,(2,1),requires_grad=True)
res1 = deserialize(*serialize(res))
print(type(res1))
There is probably additional logic that would be needed in that case. Alternatively one could override the serialization of those specific types themselves.
I'm using Dask 2022.1.0 on Python 3.8.13.
The "dask" serialization protocol has trouble preserving types. The following snippet uses the Pennylane package:
The problem seems to lie in the deserializer:
The "pickle" protocol works: