def __getattribute__(self, item):
        """Custom getattribute.

        Check that ExperienceAttribute are available in train/eval mode.
        """
        v = super().__getattribute__(item)

        if isinstance(v, ExperienceAttribute):
            if not self.are_attributes_masked:
                return v.value
            elif self._exp_mode == ExperienceMode.TRAIN and v.use_in_train:
                return v.value
            elif self._exp_mode == ExperienceMode.EVAL and v.use_in_eval:
                return v.value
            elif self._exp_mode == ExperienceMode.LOGGING:
                return v.value
            else:
                mode = "train" if self._exp_mode == ExperienceMode.TRAIN else "eval"
                se = (
                    f"Attribute {item} is not available for the experience "
                    f"in {mode} mode."
                )
                raise MaskedAttributeError(se)
        else:
            return v
Custom getattribute.

        Check that ExperienceAttribute are available in train/eval mode.
        
avalanche/benchmarks/scenarios/generic_scenario.py