Directly change values in a Variable

I am training a neural network, and I just need a subset of data for training, e.g. label of 3, 5, 8 out of 10 classes.

But for some reason, I don’t want to change the label value as the input to the network. So in my Softmax loss layer, I want to change the label set (3.5.8) to (0,1,2), so the system can train without memory issue.

So how can I change the label variable directly? Any good suggestions?

Thanks!

If you don’t want to change it during preprocessing, maybe using a fixed Embedding layer will do?