Skip to content

Commit

Permalink
try directly using the buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosuc3m committed Oct 2, 2024
1 parent f7e2908 commit 616aa98
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ private static NDArray buildFloat(SharedMemoryArray tensor, NDManager manager)
throw new IllegalArgumentException("Shared memory arrays must be saved in numpy format.");
ByteBuffer buff = tensor.getDataBufferNoHeader();
FloatBuffer floatBuff = buff.asFloatBuffer();
float[] floatArray = new float[floatBuff.capacity()];
floatBuff.get(floatArray);
NDArray ndarray = manager.create(floatBuff.array(), new Shape(ogShape));
//float[] floatArray = new float[floatBuff.capacity()];
//floatBuff.get(floatArray);
NDArray ndarray = manager.create(floatBuff, new Shape(ogShape));
return ndarray;
}

Expand Down

0 comments on commit 616aa98

Please sign in to comment.