With regards to deleting particular indices of an array, you could just redefine the array to be the old over the given indices, i.e.,
data = torch.randn(64,939,32,32)
data.shape #returns torch.Size([64, 939, 32, 32])
data = data[:,0:936,:,:]
data.shape #retuns torch.Size([64, 936, 32, 32])

One thing that came to mind was, could you not apply this custom function (which changes the batchsize) after you calculate the KL-divergence? So, I assume you have 2 Tensors which represent prediction and targets? Could you calculate the KL-divergence between the two, then apply your custom function afterward? and include the extra 3 batch value in some other way?