From 2ac0b14376ce7c87fae3bb79fcdcde2ffcd7df52 Mon Sep 17 00:00:00 2001 From: michalm Date: Tue, 8 Feb 2022 08:13:13 +0100 Subject: [PATCH 1/3] Fixes for build with the new pytorch --- csrc/cpu/neighbor_sample_cpu.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/csrc/cpu/neighbor_sample_cpu.cpp b/csrc/cpu/neighbor_sample_cpu.cpp index 23e3d498..fe1e6298 100644 --- a/csrc/cpu/neighbor_sample_cpu.cpp +++ b/csrc/cpu/neighbor_sample_cpu.cpp @@ -153,7 +153,7 @@ hetero_sample(const vector &node_types, // Add the input nodes to the output nodes: for (const auto &kv : input_node_dict) { const auto &node_type = kv.key(); - const auto &input_node = kv.value(); + const torch::Tensor &input_node = kv.value(); const auto *input_node_data = input_node.data_ptr(); auto &samples = samples_dict.at(node_type); @@ -180,8 +180,8 @@ hetero_sample(const vector &node_types, auto &src_samples = samples_dict.at(src_node_type); auto &to_local_src_node = to_local_node_dict.at(src_node_type); - const auto *colptr_data = colptr_dict.at(rel_type).data_ptr(); - const auto *row_data = row_dict.at(rel_type).data_ptr(); + const auto *colptr_data = ((torch::Tensor)colptr_dict.at(rel_type)).data_ptr(); + const auto *row_data = ((torch::Tensor)row_dict.at(rel_type)).data_ptr(); auto &rows = rows_dict.at(rel_type); auto &cols = cols_dict.at(rel_type); @@ -261,8 +261,8 @@ hetero_sample(const vector &node_types, const auto &dst_samples = samples_dict.at(dst_node_type); auto &to_local_src_node = to_local_node_dict.at(src_node_type); - const auto *colptr_data = kv.value().data_ptr(); - const auto *row_data = row_dict.at(rel_type).data_ptr(); + const auto *colptr_data = ((torch::Tensor&)kv.value()).data_ptr(); + const auto *row_data = ((torch::Tensor)row_dict.at(rel_type)).data_ptr() auto &rows = rows_dict.at(rel_type); auto &cols = cols_dict.at(rel_type); From 413b1098e6fb9872d5bcb3a331d86e5243566aba Mon Sep 17 00:00:00 2001 From: michalm Date: Tue, 8 Feb 2022 08:39:56 +0100 Subject: [PATCH 2/3] Fixes for build with the new pytorch --- csrc/cpu/neighbor_sample_cpu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csrc/cpu/neighbor_sample_cpu.cpp b/csrc/cpu/neighbor_sample_cpu.cpp index fe1e6298..46771b8d 100644 --- a/csrc/cpu/neighbor_sample_cpu.cpp +++ b/csrc/cpu/neighbor_sample_cpu.cpp @@ -262,7 +262,7 @@ hetero_sample(const vector &node_types, auto &to_local_src_node = to_local_node_dict.at(src_node_type); const auto *colptr_data = ((torch::Tensor&)kv.value()).data_ptr(); - const auto *row_data = ((torch::Tensor)row_dict.at(rel_type)).data_ptr() + const auto *row_data = ((torch::Tensor)row_dict.at(rel_type)).data_ptr(); auto &rows = rows_dict.at(rel_type); auto &cols = cols_dict.at(rel_type); From 6251bfd3a72dea4c96306a7af9f35d29b6baa982 Mon Sep 17 00:00:00 2001 From: michalm Date: Tue, 8 Feb 2022 20:43:06 +0100 Subject: [PATCH 3/3] Fixes for build with the new pytorch --- csrc/cpu/neighbor_sample_cpu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csrc/cpu/neighbor_sample_cpu.cpp b/csrc/cpu/neighbor_sample_cpu.cpp index 46771b8d..9da7edff 100644 --- a/csrc/cpu/neighbor_sample_cpu.cpp +++ b/csrc/cpu/neighbor_sample_cpu.cpp @@ -261,7 +261,7 @@ hetero_sample(const vector &node_types, const auto &dst_samples = samples_dict.at(dst_node_type); auto &to_local_src_node = to_local_node_dict.at(src_node_type); - const auto *colptr_data = ((torch::Tensor&)kv.value()).data_ptr(); + const auto *colptr_data = ((torch::Tensor)kv.value()).data_ptr(); const auto *row_data = ((torch::Tensor)row_dict.at(rel_type)).data_ptr(); auto &rows = rows_dict.at(rel_type);