Yes, the model is expected to return an output for each sample. Since you have passed 8 samples as a batch to the model also 8 outputs are expected in the output batch.
No, since PyTorch layers accept batched inputs and will launch single kernels for each operation.
It depends on your model and if it’s returning raw logits from e.g. a linear layer of if a torch.sigmoid is applied on the output before returning it.
pred = model(images),
loss = torch.nn.BCEWithLogitsLoss()(pred, true_masks)
would the output of pred be the logits numbers, so much wider range of numbers than 0 to 1? I just noticed the output over training has minus values, so just trying to understand what it represents. I have check the true_masks and they are binary with a max of 1.