Skip to content

Commit

Permalink
Data/Model: Support invoke-dynamic option
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
niley7464 authored and wooksong committed Nov 11, 2024
1 parent d242e82 commit f33b54e
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ data class Model(
}

private fun getType(list: List<String>): String {
val filtered = list.filterNot{ it.isEmpty() or it.isBlank() }
val filtered = list.filterNot { it.isEmpty() or it.isBlank() }
return if (filtered.isEmpty()) {
""
} else {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f33b54e

Please sign in to comment.