Create a GT disparity map

I have built a model using spatial pyramid attention module. the model is supposed to learn a disparity map, for now i have used as the ground truth a map with only one value. I want to make the task more complex, thus i would like the GT to be a map of size (B,3,H,W) with different value in the map ranging from -8 to 8 (but only with integer) and I don’t know how to write this matrix with pytorch since i am relatively new with this package. thanks
Thanks :slight_smile:

Could you explain a bit where you are stuck at the moment?
I guess you are unsure how to construct the map of the desired shape? If so, could you explain how each pixel would get its value?