zachgk commented on issue #16002: How to get sliding window output? URL: https://github.com/apache/incubator-mxnet/issues/16002#issuecomment-533327101 You would want to use a for loop to construct the indices input to gather_nd. ``` a = mx.nd.array([0,1,2,3,4,5]) indices = mx.nd.array([[[0,1],[1,2],[2,3],[3,4],[4,5]]]) print(mx.nd.gather_nd(a, indices)) # Outputs: # [[0. 1.] # [1. 2.] # [2. 3.] # [3. 4.] # [4. 5.]] # <NDArray 5x2 @cpu(0)> ```
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
