You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems odd to me that for a user-defined dtype, you must specify copyswap (which can be used to provide a default implementation of copyswapn), but the default behavior of np.copy (PyArray_GetDTypeTransferFunction) will end up providing a transfer method that uses memmove / memcpy.
This creates an issue when implementing dtypes that owns data which is heap-allocated, e.g. variable-size autodiff scalars.
It'd be nice if the default behavior were to leverage the user-defined copyswapn; while it would impact performance for user dtypes by default, authors could always make the implementation use something akin to what PyArray_GetStridedCopyFn returns.
Relates #10721: That issue, however, does not impact functionality per se, but more of performance since it creates memory leak. This issue, however, is a blocker for implementing these types of dtypes.
I was able to implement almost all of the features I need to make it possible to expose Eigen::AutoDiffScalar<Eigen::VectorXd> as a scalar type using pybind11 in C++; I believe this is the only main blocker for the functionality: RobotLocomotion/drake#8452 RobotLocomotion/pybind11#12
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
It seems odd to me that for a user-defined dtype, you must specify
copyswap
(which can be used to provide a default implementation ofcopyswapn
), but the default behavior ofnp.copy
(PyArray_GetDTypeTransferFunction
) will end up providing a transfer method that usesmemmove
/memcpy
.This creates an issue when implementing dtypes that owns data which is heap-allocated, e.g. variable-size autodiff scalars.
It'd be nice if the default behavior were to leverage the user-defined
copyswapn
; while it would impact performance for user dtypes by default, authors could always make the implementation use something akin to whatPyArray_GetStridedCopyFn
returns.Relates #10721: That issue, however, does not impact functionality per se, but more of performance since it creates memory leak. This issue, however, is a blocker for implementing these types of dtypes.
I was able to implement almost all of the features I need to make it possible to expose
Eigen::AutoDiffScalar<Eigen::VectorXd>
as a scalar type usingpybind11
in C++; I believe this is the only main blocker for the functionality:RobotLocomotion/drake#8452
RobotLocomotion/pybind11#12
The text was updated successfully, but these errors were encountered: