import torch


def solid(size: torch.Size):
    """ Returns noise images in form of solid colors, i.e. one randomly chosen color per image. """
    assert len(size) == 4, 'size must be n x c x h x w'
    return torch.randint(0, 256, (size[:-2]))[:, :, None, None].repeat(1, 1, size[-2], size[-1]).byte()