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(); }