Thanks for your explanation.
But in a case where the stacked one-hot encoded targets has overlapping and need to use the approach of multiclass, how would one handle the target since the index of the first 1 in corresponding pixel values of the stacked target will be given when taking its argmax? For example
torch.manual_seed(19)
outputs = torch.randint(low=0, high=2, size=(1,3,5,5), dtype=torch.float32)

# overlapping pixel value
for i in range(labelA.shape[1]):
    print(labelA[:, i, 2, :]) #[0,0,2,5]

###
print(torch.argmax(labelA, 1)) # 1,1,5

loss = nn.CrossEntropyLoss()
loss_value = loss(outputs, torch.argmax(labelA, 1))
print(loss_value)