import cupy print(cupy.__version__) 综上所述,如果你遇到 module 'cupy.cuda' has no attribute 'compile_with_cache' 错误,很可能是因为你的CuPy版本高于v10,而你的代码还在尝试使用已被移除的 compile_with_cache 方法。你应该更新你的代码,使用 cupy.RawKernel 来替代 compile_with_cache 方法。
We read every piece of feedback, and take your input very seriously. Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Cancel Create saved search Sign in Sign up Reseting focus {...
{integrity: sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==} engines: {node: '>=6.0.0'} '@jridgewell/resolve-uri@3.1.2': resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBT...
This attribute is not available when the model has been trained with sparse data. n_features_ : int Number of features of each sample. Examples --- .. code-block:: python >>> import cupy as cp >>> rng = cp.random.RandomState(1) >>> X = rng.randint(5, size=(6, 100), dtype...
(self.n_classes_) elif _is_cupy_array(y): import cupy as cp # pylint: disable=E0401 self.classes_ = cp.unique(y) self.n_classes_ = len(self.classes_) expected_classes = cp.arange(self.n_classes_) else: self.classes_ = np.unique(np.asarray(y)) self.n_classes_ = ...