From edde4740e4fc9238a4fb14cbf5322c798d4620da Mon Sep 17 00:00:00 2001 From: carlosuc3m <49989524+carlosuc3m@users.noreply.github.com> Date: Mon, 4 Sep 2023 18:22:47 +0200 Subject: [PATCH] Update README.md --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 8b3b895b..9660aefc 100644 --- a/README.md +++ b/README.md @@ -161,7 +161,23 @@ More information about tensors can be found in the [JDLL wiki](https://github.co ## 5. Running the model +Once the model has been loaded and the input and output tensors have been created. Running the model is simple. The input tensors should be added to a `List` in the same order the model expects. Same for the ouptuts in another `List`. +``` +List> inputList = new ArrayList>>(); +List> outputputList = new ArrayList>>(); + +inputList.add(inputTensor); +outputputList.add(outputEmptyTensor); +System.out.println("Ouptut tensor is empty: " + outputEmptyTensor.isEmpty()); +model.runModel(inputList, outputputList); +System.out.println("Ouptut tensor after inference is empty: " + outputEmptyTensor.isEmpty()); +``` +Output: +``` +Ouptut tensor is empty: true +Ouptut tensor after inference is empty: false +``` ## 6. Closing the model and the tensors