File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
src/main/java/io/bioimage/modelrunner/pytorch/javacpp/shm Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change 2525import io .bioimage .modelrunner .utils .CommonUtils ;
2626
2727import java .nio .ByteBuffer ;
28+ import java .nio .ByteOrder ;
2829import java .util .Arrays ;
2930
3031import org .bytedeco .pytorch .Tensor ;
@@ -134,7 +135,7 @@ private static org.bytedeco.pytorch.Tensor buildFloat(SharedMemoryArray shmArray
134135 + " is too big. Max number of elements per ubyte tensor supported: " + Integer .MAX_VALUE );
135136 if (!shmArray .isNumpyFormat ())
136137 throw new IllegalArgumentException ("Shared memory arrays must be saved in numpy format." );
137- ByteBuffer buff = shmArray .getDataBufferNoHeader ();
138+ ByteBuffer buff = shmArray .getDataBufferNoHeader (). order ( ByteOrder . LITTLE_ENDIAN ) ;
138139 float [] flat = new float [buff .capacity () / 4 ];
139140 buff .asFloatBuffer ().get (flat );
140141 Tensor ndarray = Tensor .create (flat , ogShape );
You can’t perform that action at this time.
0 commit comments