Based on the error message self.locations has a size of 4 in dim0 while you are trying to index it with a value of 2169. Make sure to initialize self.locations with the appropriate shape.
Also, don’t use torch.Tensor as it could yield unexpected results.
E.g. you are currently initializing self.locations via:
self.locations = nn.Parameter(torch.Tensor(list(self.get_map_index())), requires_grad=False)

which would create a FloatTensor containing the list values while you might want to use the list values as a shape.
Use the factory methods (torch.randn, torch.ones, torch.tensor etc.) instead.