From 68eba2ee8fdc80980118f908a3dcfaf37d46b2fc Mon Sep 17 00:00:00 2001 From: carlosuc3m <100329787@alumnos.uc3m.es> Date: Thu, 19 Dec 2024 19:47:45 +0100 Subject: [PATCH] try big endian --- .../bioimage/modelrunner/pytorch/javacpp/shm/TensorBuilder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/bioimage/modelrunner/pytorch/javacpp/shm/TensorBuilder.java b/src/main/java/io/bioimage/modelrunner/pytorch/javacpp/shm/TensorBuilder.java index eef30bd..af30b9c 100644 --- a/src/main/java/io/bioimage/modelrunner/pytorch/javacpp/shm/TensorBuilder.java +++ b/src/main/java/io/bioimage/modelrunner/pytorch/javacpp/shm/TensorBuilder.java @@ -135,7 +135,7 @@ private static org.bytedeco.pytorch.Tensor buildFloat(SharedMemoryArray shmArray + " is too big. Max number of elements per ubyte tensor supported: " + Integer.MAX_VALUE); if (!shmArray.isNumpyFormat()) throw new IllegalArgumentException("Shared memory arrays must be saved in numpy format."); - ByteBuffer buff = shmArray.getDataBufferNoHeader().order(ByteOrder.LITTLE_ENDIAN); + ByteBuffer buff = shmArray.getDataBufferNoHeader().order(ByteOrder.BIG_ENDIAN); float[] flat = new float[buff.capacity() / 4]; buff.asFloatBuffer().get(flat); Tensor ndarray = Tensor.create(flat, ogShape);