From f33b54e54b1b3e5cee027dd480d229b91eefc9fa Mon Sep 17 00:00:00 2001 From: Yelin Jeong Date: Fri, 1 Nov 2024 10:28:23 +0900 Subject: [PATCH] Data/Model: Support invoke-dynamic option This patch supports invoke-dynamic option at tensor_filter. If output tensor format is flexible, invoke-dynamic has to be set TRUE. Signed-off-by: Yelin Jeong --- .../ai/nnstreamer/ml/inference/offloading/data/Model.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ml_inference_offloading/src/main/java/ai/nnstreamer/ml/inference/offloading/data/Model.kt b/ml_inference_offloading/src/main/java/ai/nnstreamer/ml/inference/offloading/data/Model.kt index f521e77..781bcf0 100644 --- a/ml_inference_offloading/src/main/java/ai/nnstreamer/ml/inference/offloading/data/Model.kt +++ b/ml_inference_offloading/src/main/java/ai/nnstreamer/ml/inference/offloading/data/Model.kt @@ -134,7 +134,7 @@ data class Model( } private fun getType(list: List): String { - val filtered = list.filterNot{ it.isEmpty() or it.isBlank() } + val filtered = list.filterNot { it.isEmpty() or it.isBlank() } return if (filtered.isEmpty()) { "" } else { @@ -177,9 +177,11 @@ data class Model( val inDims = inputInfo["dimension"]?.let { getDimension(it) } ?: "" val outDims = outputInfo["dimension"]?.let { getDimension(it) } ?: "" + val invokeDynamic = if (outFormat != "static") "TRUE" else "FALSE" + val filter = "other/tensors,format=${inFormat}${inTensors}${inDims}${inTypes},framerate=0/1 ! " + - "tensor_filter framework=${framework} model=${modelPaths} ! " + + "tensor_filter framework=${framework} model=${modelPaths} invoke-dynamic=$invokeDynamic ! " + "other/tensors,format=${outFormat}${outTensors}${outDims}${outTypes},framerate=0/1" return filter