esa / pygmo2

A Python platform to perform parallel computations of optimisation tasks (global and local) via the asynchronous generalized island model.
https://esa.github.io/pygmo2/
Mozilla Public License 2.0
422 stars 57 forks source link

Jointly use PyTorch and Pygmo #54

Closed jingyao-zhang closed 4 years ago

jingyao-zhang commented 4 years ago

When I try to use pytoch and pygmo jointly, the RuntimeError: Unable to cast Python instance to C++ type occours.

1) Is there a way to use pytorch in pygmo?

2) Should I use pagmo instead, with c++ of pytorch, because the error is the cast from python to c++?

bluescarni commented 4 years ago

@Ssicayoon it's not possible for us to help you without more specific info. Perhaps you can come over to the gitter channel, where it might be easier to have a discussion?

https://gitter.im/pagmo2/Lobby

jingyao-zhang commented 4 years ago

@bluescarni Thanks for your reply! I have found and fixed the problem, the wrong data type tensor for Pygmo functions.