I know where is wrong, when I modified a and b like this
a = torch.tensor(tmp, requires_grad=False, dtype=torch.float64)
b = torch.tensor(pixel_flow, requires_grad=False, dtype=torch.float64)

it works!