Making a new type of tensor [1,2,2] -> [[0, 1, 1] [1, 1, 0] [1,1, 0]]

I have 3 classes and want to make a new type of tensor with a label tensor.

Label tensor = [1,2,2]

New tensor =
[[0, 1, 1]
[1, 1, 0]
[1,1, 0]]

How can I make this easily?
Thanks in advance!!

Could you explain how the labels would be converted to the new tensor, as I might miss the obvious pattern?