raise TypeError(f"The factor should be either a float or torch.Tensor. "
f"Got {type(brightness_factor)}")
if isinstance(brightness_factor, float):
brightness_factor = torch.tensor([brightness_factor])
brightness_factor = brightness_factor.to(input.device).to(input.dtype)
if (brightness_factor < torch.zeros(1)).any():
raise ValueError(f"Brightness factor must be non-negative. Got {brightness_factor}")