Skip to content

Commit

Permalink
keep trying to display the output
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosuc3m committed Jan 2, 2025
1 parent 5765157 commit b6d3826
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,10 @@ private static void buildFromTensorFloat(Tensor<Float> tensor, String memoryName
SharedMemoryArray shma = SharedMemoryArray.readOrCreate(memoryName, arrayShape, new FloatType(), false, true);
ByteBuffer buff = shma.getDataBufferNoHeader();
tensor.writeTo(buff);

try (FileOutputStream fos = new FileOutputStream("/home/carlos/git/interp_out" + UUID.randomUUID().toString() + ".npy");
FileChannel fileChannel = fos.getChannel()) {
buff.rewind();
// Write the buffer's content to the file
while (buff.hasRemaining()) {
fileChannel.write(buff);
}
buff.rewind();
fileChannel.write(ByteBuffer.wrap(tensor.bytesValue()));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Expand Down

0 comments on commit b6d3826

Please sign in to comment.