You can construct a NumPy array representing all the indices that needs to be included. The shape of this array should be N x L. Then, use this array to retrieve the elements of interest by indexing the tensor.