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 0a1b16b..c31281c 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 @@ -117,7 +117,7 @@ private static void buildFromTensorFloat(Tensor tensor, String memoryName) throw ByteBuffer byteBuffer = ByteBuffer.allocateDirect((int) (flatSize * Float.BYTES)); FloatBuffer floatBuffer = byteBuffer.asFloatBuffer(); tensor.data_ptr_float().get(flat); - floatBuffer.put(flatSize); + floatBuffer.put(flat); byteBuffer.rewind(); shma.getDataBufferNoHeader().put(byteBuffer); if (PlatformDetection.isWindows()) shma.close();