I’m sorry, but I still think I misunderstand the use case.
If label contains a single integer (3), its shape would be [1] or [1, 1]. Are you expanding it to [1, 10] or how are these 10 values defined?
Could you post a small example with input tensors and the desired output?
This could maybe make it easier to write the desired code for the wanted operation.