Convert an Array to PyTorch IValue on Android
Simple question.
I have an array of ints in Android (Kotlin). I need to convert it to an org.pytorch.IValue. I believe that such a conversion can be done, but I can't figure out how to do it. This is my array
val array = Array(34)     { IntArray(1) }
How do I get this wrapped in an IValue?

I found the way to do this by way of the Tensor object. The Tensor class has a static method for creating tensor buffers, such as by Tensor.allocateIntBuffer(). The argument for that call accepts the number of elements that the buffer will contain. The .put() method on the buffer places items within the buffer. Once the buffer is populated, it can be converted to an IValue with IValue.from(sourceTensor).
