https://github.com/gentlemanman/fcrn_pytorch/blob/5cb562272d9939d9f9886b0fdb8768d84b998e90/fcrn.py#L51
you can just do:
batch_size = x.shape[0]
instead of hard coding it into the network.
if you hard code it, different batch sizes (e.g. in summary() or on the last batch of images) will screw up.