From f1614dfd97f57442b8d2db2b37da14ad449cb3e2 Mon Sep 17 00:00:00 2001 From: Jonas Rembser Date: Thu, 1 Oct 2026 19:47:16 +0000 Subject: [PATCH] Revert "[tmva][sofie] Pass senders/receivers as int64_t pointers in GNN tutorial" This reverts commit bb5fa2785b87304e0ecd11250536ff66b97ad16d. The conversion of numpy int64 arrays to 'const int64_t*' parameters is now fixed in cppjit itself as of 45c723fdb476, so the explicit `cppyy.ll.cast workaround` is not needed anymore. The tutorial passes the numpy arrays directly again. --- tutorials/machine_learning/TMVA_SOFIE_GNN.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tutorials/machine_learning/TMVA_SOFIE_GNN.py b/tutorials/machine_learning/TMVA_SOFIE_GNN.py index 121fb14d86ebd..4112effc6fa51 100644 --- a/tutorials/machine_learning/TMVA_SOFIE_GNN.py +++ b/tutorials/machine_learning/TMVA_SOFIE_GNN.py @@ -13,7 +13,6 @@ ## ## \author -import cppyy import time import numpy as np @@ -201,9 +200,6 @@ def c(x): receivers = np.ascontiguousarray(graphData["receivers"], dtype=np.int64) senders = np.ascontiguousarray(graphData["senders"], dtype=np.int64) - i64p = cppyy.ll.cast["const int64_t*"] - receivers_ptr = i64p(receivers.ctypes.data) - senders_ptr = i64p(senders.ctypes.data) latent = self._as_arrays( self.encoder_session.infer(c(graphData["nodes"]), c(graphData["edges"]), c(graphData["globals"])), @@ -214,8 +210,8 @@ def c(x): for _ in range(processing_steps): core_input = tuple(np.concatenate([a, b], axis=1) for a, b in zip(latent0, latent)) latent = self._as_arrays( - self.core_session.infer(c(core_input[0]), c(core_input[1]), c(core_input[2]), receivers_ptr, senders_ptr), - n_nodes, n_edges, + self.core_session.infer(c(core_input[0]), c(core_input[1]), c(core_input[2]), receivers, senders), + n_nodes, n_edges, ) decoded = self._as_arrays( self.decoder_session.infer(c(latent[0]), c(latent[1]), c(latent[2])), n_nodes, n_edges