How about this?
number1 = 3 # look for 3 in column 1
number2 = 4
column1 = A[:,0]
column2 = A[:,1]
_, index1 = torch.min(torch.abs(column1 - number1), 0)
_, index2 = torch.min(torch.abs(column2 - number2), 0)

N.B. This isn’t differentiable.