Behavior of torch.unique

You are right, I read your first comment more carefully after reading this in your second

My code snippet returns the unique rows, then the unique columns, and finally the unique scalars.

Essentially using dim I can select unique rows or unique dimension as a whole. This has nothing to do with padding!! So the usage gives “unique rows” and not “here are the unique elements of each row”

What I should be looking at is the scalars themselves within each dimension which is to say what are the unique scalars in each entry of the dimension specified.

Thanks, I now understand things better.