Currently, GPU usage is not explicitly handled in the model base class.
To provide better flexibility, we should introduce a mechanism to switch between NumPy and CuPy based on user preference.
Proposed Solution:
- Convert
np into a class attribute in the model base class.
- If the user wants to use the GPU, set
np to CuPy (cupy).
- Otherwise, default to NumPy (
numpy).
This change will allow seamless switching between CPU and GPU computations without modifying other parts of the code.
Additional Context:
This approach will improve performance for users who want GPU acceleration while maintaining compatibility for CPU-only environments.
Currently, GPU usage is not explicitly handled in the model base class.
To provide better flexibility, we should introduce a mechanism to switch between NumPy and CuPy based on user preference.
Proposed Solution:
npinto a class attribute in the model base class.npto CuPy (cupy).numpy).This change will allow seamless switching between CPU and GPU computations without modifying other parts of the code.
Additional Context:
This approach will improve performance for users who want GPU acceleration while maintaining compatibility for CPU-only environments.