def __post_init__()

in src/chug/common/config.py [0:0]


    def __post_init__(self):
        image_chs = self.image_chs
        if image_chs is not None:
            # ensue mean/std attributes match # image_chs
            for attr_name in ('mean', 'std'):
                attr = getattr(self, attr_name)
                if attr is not None and not isinstance(attr, Sequence):
                    attr = (attr,)
                if image_chs == 1 and len(attr) > image_chs:
                    attr = (sum(attr) / len(attr),)
                if image_chs > 1 and len(attr) == 1:
                    attr = attr * image_chs
                assert len(attr) == image_chs
                setattr(self, attr_name, attr)

            # ensure fill color matches image_chs
            if self.fill_color is not None:
                if not isinstance(self.fill_color, Sequence):
                    self.fill_color = (self.fill_color,)
                if image_chs == 1 and len(self.fill_color) > image_chs:
                    self.fill_color = (int(sum(self.fill_color) / len(self.fill_color)),)
                if image_chs > 1 and len(self.fill_color) == 1:
                    self.fill_color  = self.fill_color * image_chs