@Venryx You have to do it yourself. If you use Kotlin, you have a method https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/flatten.html 22
If you use Java, you can do it recursively (https://stackoverflow.com/questions/31851548/flatten-nested-arrays-in-java 48 might help, I didn’t check the content).
In my case, my model is expecting an array of float of dimension (n, b, m). So in kotlin:
...
val input: Tensor = Tensor.fromBlob(myFloatArray, longArrayOf(n, b, m))
val output: Tensor = module.forward(IValue.from(input))!!.toTensor() 
...

You can find the doc there: https://pytorch.org/docs/1.3.0/org/pytorch/Tensor.html#id2 49
Hope it helps.