Skip to content

Commit

Permalink
try big endian
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosuc3m committed Dec 19, 2024
1 parent d170837 commit 68eba2e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 68eba2e

Please sign in to comment.