If you want to take form the second dimension, you can use the indexing syntax like: x = feat[:, base-5, base+5]. Or you can use the specialized function to get a subset: x = feat.narrow(1, base - 5, 10). The two will give exactly the same result.