I'm searching how I can convert a INDArray of N lines and 1 column to a List (ArrayList or something else, doesn't matter) object.
I could cast multiple times the object, using myIndarray.data()
to get a DataBuffer, then transform the DataBuffer to get an int array, then an ArrayList, but it seems a bit farfetched:
List myList = Arrays.asList(myArray.data().asInt());
Another solution would be to iterate over the array and put all the elements into the ArrayList but it doesn't seem very efficient.
Is there a clean way of doing this?