How to pass a list index to tensor with pytorch 0.3.1?

I have a tensor size of 3x2x32x32 (BxCxHxW) and a list of row index that used to assign to zero row postion of the tensor. For example, index_zeros_list=[2,5,9] means all value in the row 3th, 6th, and 10th (index from 0) will be zero. I used bellow code in pytorch 0.3.1 and it got the below error. Could you have me to fix it? it worked in pytorch 0.4.1

input_tensor = torch.randn(B, C, H, W)
input_tensor =Variable(input_tensor).cuda()
index_zeros_list = random.sample(range(0, H), 5)
input_tensor[:, :, index_zeros_list, :] = 0

The error is

TypeError: Performing basic indexing on a tensor and encountered an error indexing dim 2 with an object of type list. The only supported types are integers, slices, numpy scalars, or if indexing with a torch.LongTensor or torch.ByteTensor only a single Tensor may be passed.