Writing functions that specifically CuPy is not necessary anymore after NumPy 1.17 because of the array function protocol. Due to this API feature, NumPy functions that are passed CuPy arrays will automatically call the corresponding CuPy functions instead of trying to convert them to NumPy arrays.
Writing functions that specifically CuPy is not necessary anymore after NumPy 1.17 because of the array function protocol. Due to this API feature, NumPy functions that are passed CuPy arrays will automatically call the corresponding CuPy functions instead of trying to convert them to NumPy arrays.
https://numpy.org/neps/nep-0018-array-function-protocol.html