From 76c81435d0caaf399a25606e371ec9708d8fc636 Mon Sep 17 00:00:00 2001 From: carlosuc3m <100329787@alumnos.uc3m.es> Date: Sun, 24 Nov 2024 22:56:45 +0100 Subject: [PATCH] commit --- .../modelrunner/pytorch/javacpp/shm/ShmBuilder.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/io/bioimage/modelrunner/pytorch/javacpp/shm/ShmBuilder.java b/src/main/java/io/bioimage/modelrunner/pytorch/javacpp/shm/ShmBuilder.java index c5b2486..8df7fdb 100644 --- a/src/main/java/io/bioimage/modelrunner/pytorch/javacpp/shm/ShmBuilder.java +++ b/src/main/java/io/bioimage/modelrunner/pytorch/javacpp/shm/ShmBuilder.java @@ -138,12 +138,11 @@ private static void buildFromTensorFloat(Tensor tensor, String memoryName) throw FloatBuffer floatBuffer = byteBuffer.asFloatBuffer(); tensor.data_ptr_float().get(flat); floatBuffer.put(flat); - byteBuffer.rewind(); - float sum = 0; - for (float ff : flat) - sum += ff; - System.out.println("SUMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA: " + sum); shma.getDataBufferNoHeader().put(byteBuffer); + System.out.println("equals " + (shma.getDataBufferNoHeader().get(100) == byteBuffer.get(100))); + System.out.println("equals " + (shma.getDataBufferNoHeader().get(500) == byteBuffer.get(500))); + System.out.println("equals " + (shma.getDataBufferNoHeader().get(300) == byteBuffer.get(300))); + System.out.println("equals " + (shma.getDataBufferNoHeader().get(1000) == byteBuffer.get(1000))); if (PlatformDetection.isWindows()) shma.close(); }