Skip to content

Commit

Permalink
PyTorch 2.0 fix (#160)
Browse files Browse the repository at this point in the history
* update

* update
  • Loading branch information
rusty1s authored Jan 23, 2023
1 parent b3d445c commit 82e9df9
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions csrc/version.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#ifdef WITH_PYTHON
#include <Python.h>
#endif
#include <torch/script.h>
#include "cluster.h"
#include "macros.h"
#include <torch/script.h>

#ifdef WITH_CUDA
#ifdef USE_ROCM
Expand All @@ -23,7 +23,6 @@ PyMODINIT_FUNC PyInit__version_cpu(void) { return NULL; }
#endif
#endif


namespace cluster {
CLUSTER_API int64_t cuda_version() noexcept {
#ifdef WITH_CUDA
Expand All @@ -36,8 +35,7 @@ CLUSTER_API int64_t cuda_version() noexcept {
return -1;
#endif
}
} // namespace sparse

} // namespace cluster

static auto registry =
torch::RegisterOperators().op("torch_cluster::cuda_version", &cluster::cuda_version);
static auto registry = torch::RegisterOperators().op(
"torch_cluster::cuda_version", [] { return cluster::cuda_version(); });

0 comments on commit 82e9df9

Please sign in to comment.