def __init_subclass__(cls):
// 1d transforms are always separable; we assume higher-dimensional ones
// are not but subclasses can also directly set is_separable.
if ("is_separable" not in vars(cls) // Was it overridden explicitly?
and cls.input_dims == cls.output_dims == 1):
cls.is_separable = True
// Transform.inverted raises NotImplementedError; we assume that if this
After Change
// are not but subclasses can also directly set is_separable -- this is
// verified by checking whether "is_separable" appears more than once in
// the class"s MRO (it appears once in Transform).
if (sum("is_separable" in vars(parent) for parent in cls.__mro__) == 1
and cls.input_dims == cls.output_dims == 1):
cls.is_separable = True
// Transform.inverted raises NotImplementedError; we assume that if this