|
25 | 25 | import io.bioimage.modelrunner.utils.CommonUtils;
|
26 | 26 | import net.imglib2.util.Cast;
|
27 | 27 |
|
28 |
| -import java.io.FileOutputStream; |
29 |
| -import java.io.IOException; |
30 | 28 | import java.nio.ByteBuffer;
|
31 | 29 | import java.nio.DoubleBuffer;
|
32 | 30 | import java.nio.FloatBuffer;
|
33 | 31 | import java.nio.IntBuffer;
|
34 | 32 | import java.nio.LongBuffer;
|
35 |
| -import java.nio.channels.FileChannel; |
36 | 33 | import java.util.Arrays;
|
37 |
| -import java.util.UUID; |
38 | 34 |
|
39 | 35 | import org.tensorflow.Tensor;
|
40 | 36 | import org.tensorflow.types.UInt8;
|
@@ -137,19 +133,6 @@ private static Tensor<Float> buildFloat(SharedMemoryArray tensor)
|
137 | 133 | + " is too big. Max number of elements per ubyte tensor supported: " + Integer.MAX_VALUE);
|
138 | 134 | if (!tensor.isNumpyFormat())
|
139 | 135 | throw new IllegalArgumentException("Shared memory arrays must be saved in numpy format.");
|
140 |
| - try (FileOutputStream fos = new FileOutputStream("/home/carlos/git/interp_inp" + UUID.randomUUID().toString() + ".npy"); |
141 |
| - FileChannel fileChannel = fos.getChannel()) { |
142 |
| - ByteBuffer buffer = tensor.getDataBuffer(); |
143 |
| - // Write the buffer's content to the file |
144 |
| - while (buffer.hasRemaining()) { |
145 |
| - fileChannel.write(buffer); |
146 |
| - } |
147 |
| - buffer.rewind(); |
148 |
| - } catch (IOException e) { |
149 |
| - // TODO Auto-generated catch block |
150 |
| - e.printStackTrace(); |
151 |
| - } |
152 |
| - |
153 | 136 | ByteBuffer buff = tensor.getDataBufferNoHeader();
|
154 | 137 | FloatBuffer floatBuff = buff.asFloatBuffer();
|
155 | 138 | Tensor<Float> ndarray = Tensor.create(ogShape, floatBuff);
|
|
0 commit comments