Libtorch can use "target[c][label == c] = 1" like python?

c is channel values that integer constant。label is a tensor with shape {h,w}.Thank you very much!