Skip to content

Commit 82e9df9

Browse files
authored
PyTorch 2.0 fix (#160)
* update * update
1 parent b3d445c commit 82e9df9

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

csrc/version.cpp

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#ifdef WITH_PYTHON
22
#include <Python.h>
33
#endif
4-
#include <torch/script.h>
54
#include "cluster.h"
65
#include "macros.h"
6+
#include <torch/script.h>
77

88
#ifdef WITH_CUDA
99
#ifdef USE_ROCM
@@ -23,7 +23,6 @@ PyMODINIT_FUNC PyInit__version_cpu(void) { return NULL; }
2323
#endif
2424
#endif
2525

26-
2726
namespace cluster {
2827
CLUSTER_API int64_t cuda_version() noexcept {
2928
#ifdef WITH_CUDA
@@ -36,8 +35,7 @@ CLUSTER_API int64_t cuda_version() noexcept {
3635
return -1;
3736
#endif
3837
}
39-
} // namespace sparse
40-
38+
} // namespace cluster
4139

42-
static auto registry =
43-
torch::RegisterOperators().op("torch_cluster::cuda_version", &cluster::cuda_version);
40+
static auto registry = torch::RegisterOperators().op(
41+
"torch_cluster::cuda_version", [] { return cluster::cuda_version(); });

0 commit comments

Comments
 (0)