code to print information about only one batch
I want to view information about my variables (type, min,max,std etc). While I write code below, it shows me information about all images in all batches. Please, tell me code, that will show me information about only one batch (something like "for batch [0], print(type(input))"

My code:

for t,(input, image_id) in enumerate(loader):
    print(image_id)

    input = input.cuda()
    with torch.no_grad():
        logit = net(input)
        probabilityy= torch.sigmoid(logit)

    probability = probabilityy.data.cpu().numpy()
    batch_size = len(image_id)
    for b in range(batch_size):
        p = probability[b]
        for c in range(4):
            predict, num = post_process(p[c], threshold, min_size)

            rle = run_length_encode(predict)


    print('input shape: ',input.shape)
    print('input ndim qty osi: ',input.ndim)
    print('input type: ',input.type)
    print('input mean std max min: ',input.mean(),input.std(),input.max(),input.min(),'\n')
    print('input: ',input[0,0:3,100:105,100:105])`


Usually, torch.DataLoader objects have a __getitem__ dunder method, so you should be able to use indexing to select one batch. But, I haven't seen how you load the data, so a universal solution would be to just break the loop:

# ...
print('input: ',input[0,0:3,100:105,100:105])
break


Like that, it won't move on to the next loop iteration and will effectively only execute this once, i.e., on the first batch.
