cupyx.scipy.get_array_module#

cupyx.scipy.get_array_module(*args)[source]#

返回参数的数组模块。

此函数用于实现 CPU/GPU 通用代码。如果参数中至少有一个是 cupy.ndarray 对象,则返回 cupyx.scipy 模块。

参数:

args – 用于确定应使用 NumPy 还是 CuPy 的值。

返回:

根据参数类型返回 cupyx.scipyscipy

返回类型:

模块