Solved by KFrank in post #4 
              
              
                Hi zzzf! 

There are a couple of ways of going about this.  Probably the most 
flexible and most logically straightforward will be to index into a lookup 
table with your three-channel colors. 
Here is a demonstration script: 
import torch
print (torch.__version__)
# convert rgb mask to integer clas…