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)
// direction from [-1, 1] to [0, 1] range
direction = (torch.clamp(torch.tensor(direction), -1., 1.).item() + 1.) / 2.
kernel = torch.zeros(kernel_tuple, dtype=torch.float)