Direction through coordinates

Hi! First, I’d like to apologize, I’m really new to PyTorch and am trying to learn as much as I can.

I am trying to create a model that can take two coordinate points from a grid, the first being the current spot and the second being the goal spot, and output a number from 0 to 3 that corresponds with a direction to move on the grid.

The goal is to have a model that can learn the shortest distance between two coordinate points without programming in the distance formula. If I have tensor X with pairs of coordinates as a feature and tensor Y with the appropriate movement in the right direction for each pair within X as a label, how can I make a model that can accurately give a direction for a pair of points? I would really appreciate guidance, advice or a point to the right direction