if not isinstance(kernel_size, int) or kernel_size % 2 == 0 or kernel_size < 3:
raise TypeError("ksize must be an odd integer >= than 3")
if not isinstance(angle, float):
raise TypeError("angle must be a float")
if not isinstance(direction, float):
raise TypeError("direction must be a float")
kernel_tuple: Tuple[int, int] = (kernel_size, kernel_size)
After Change
if not isinstance(kernel_size, int) or kernel_size % 2 == 0 or kernel_size < 3:
raise TypeError("ksize must be an odd integer >= than 3")
if not isinstance(angle, torch.Tensor):
angle = torch.tensor(angle)
assert angle.dim() == 0, f"angle must be a 0-dim tensor. Got {angle}."
if not isinstance(direction, torch.Tensor):
direction = torch.tensor(direction)