From f151b89507bb0a1fcd67243a86786a3f80d4926d Mon Sep 17 00:00:00 2001 From: Sanjiban Sengupta Date: Thu, 1 Oct 2026 16:57:29 +0200 Subject: [PATCH 1/2] [tmva][sofie] explicit cast of senders and receivers to int64_t in TMVA_SOFIE_GNN tutorial through cppyy for safe run in mac --- tutorials/machine_learning/TMVA_SOFIE_GNN.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tutorials/machine_learning/TMVA_SOFIE_GNN.py b/tutorials/machine_learning/TMVA_SOFIE_GNN.py index 4112effc6fa51..654035d60f476 100644 --- a/tutorials/machine_learning/TMVA_SOFIE_GNN.py +++ b/tutorials/machine_learning/TMVA_SOFIE_GNN.py @@ -13,6 +13,7 @@ ## ## \author +import cppyy import time import numpy as np @@ -200,6 +201,9 @@ 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"])), From eeec63cfc1ebe8204b06f48125c9086cf0ef7f75 Mon Sep 17 00:00:00 2001 From: Sanjiban Sengupta Date: Thu, 1 Oct 2026 17:05:53 +0200 Subject: [PATCH 2/2] [tmva][sofie] use casted pointers in infer method of core model --- tutorials/machine_learning/TMVA_SOFIE_GNN.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tutorials/machine_learning/TMVA_SOFIE_GNN.py b/tutorials/machine_learning/TMVA_SOFIE_GNN.py index 654035d60f476..121fb14d86ebd 100644 --- a/tutorials/machine_learning/TMVA_SOFIE_GNN.py +++ b/tutorials/machine_learning/TMVA_SOFIE_GNN.py @@ -214,8 +214,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, senders), - n_nodes, n_edges, + self.core_session.infer(c(core_input[0]), c(core_input[1]), c(core_input[2]), receivers_ptr, senders_ptr), + 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