Hmmm if you are in cpu a look-up table.
If you are in GPU don’t really know. Guess a dictionary would require synchronization to the cpu. Still don’t know if the nn.ModuleDict allows to use a tensor as key.
If that were the case you can use the standard mapping  aka
if if ‘0’ is 45 then 3 is 48 and can do that in gpu.