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