I want to perform slicing in Nd4j of arbitrary sizes in the same manner as I am able to do using Numpy.
a = numpy.arange(100)
a[25:50]
The nd4j slice method only takes dimension and index arguments, not length. How can I achieve this?
I want to perform slicing in Nd4j of arbitrary sizes in the same manner as I am able to do using Numpy.
a = numpy.arange(100)
a[25:50]
The nd4j slice method only takes dimension and index arguments, not length. How can I achieve this?
I know it's an old question but I ran across it while googling this problem exactly.
By inspecting the source code for
slice
I believe it can only return full rows/columns not partial from index to index. You can use methodget
with anNDArrayIndex
instance s argument for that. This code for example is a translation of yournumpy
code.NDArrayIndex documentation