from torch.optim.lr_scheduler import _LRScheduler, ReduceLROnPlateau
# _LRScheduler can be imported, just ignore the error hint of your IDE
# The only exception is that ReduceLROnPlateau not inherits from _LRScheduler


isinstance(something, (_LRScheduler, ReduceLROnPlateau))