Yes, exactly. Your model should output a high probability of all classes but class3 for this sample.
Sure, a batch may contain multiple samples with the same class, but my code snippet currently works on a single sample. What would the two 2s mean in that case?