Extract sliding windows of size size along dimension dim with stride step. Result has one extra dimension appended containing the window elements.