From f2c3e15930a0f8d9b6082d73d6060e66a122a5b4 Mon Sep 17 00:00:00 2001 From: carlosuc3m <100329787@alumnos.uc3m.es> Date: Thu, 19 Dec 2024 19:12:43 +0100 Subject: [PATCH] more prints --- .../pytorch/javacpp/PytorchJavaCPPInterface.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/bioimage/modelrunner/pytorch/javacpp/PytorchJavaCPPInterface.java b/src/main/java/io/bioimage/modelrunner/pytorch/javacpp/PytorchJavaCPPInterface.java index 6a3c13c..bc3caa0 100644 --- a/src/main/java/io/bioimage/modelrunner/pytorch/javacpp/PytorchJavaCPPInterface.java +++ b/src/main/java/io/bioimage/modelrunner/pytorch/javacpp/PytorchJavaCPPInterface.java @@ -321,7 +321,7 @@ else if (task.status == TaskStatus.CRASHED) { shmaOutputList.add(shm); } RandomAccessibleInterval rai = shm.getSharedRAI(); - System.out.println("Output size: " + Arrays.asList(rai.dimensionsAsLongArray())); + System.out.println("Output size: " + Arrays.toString(rai.dimensionsAsLongArray())); // TODO remove double max0 = 0; Cursor iter0 = Views.iterable(rai).cursor(); @@ -432,7 +432,16 @@ private & NativeType> List encodeInputs(List encodedInputTensors = new ArrayList(); Gson gson = new Gson(); for (Tensor tt : inputTensors) { - System.out.println("Input size: " + Arrays.asList(tt.getData().dimensionsAsLongArray())); + System.out.println("Input size: " + Arrays.toString(tt.getData().dimensionsAsLongArray())); + double max0 = 0; + Cursor iter0 = Views.iterable(tt.getData()).cursor(); + while (iter0.hasNext()) { + iter0.next(); + double doub = iter0.get().getRealDouble(); + if (doub > max0) + max0 = doub; + } + System.out.println("Input max: " + max0); SharedMemoryArray shma = SharedMemoryArray.createSHMAFromRAI(tt.getData(), false, true); shmaInputList.add(shma); HashMap map = new HashMap();