[primTorch] Refs for pdist, triu and related ops (#82819)
This PR adds refs for the following ops:
- `torch.triu`
- `torch.tril`
- `torch.triu_indices`
- `torch.tril_indices`
- `torch.nn.functional.pairwise_distance`
- `torch.nn.functional.pdist`
It adds OpInfos for
- `torch.triu_indices`
- `torch.tril_indices`
Note that these were already tested in `test/test_tensor_creation_ops.py`
but for the ref tests we need the OpInfos.
Finally, it improves documentation for PairwiseDistance and adds
a missing import to `torch/testing/_internal/opinfo/core.py`.
This started with an attempt to just add the `nn.functional` refs above,
but it turned out that `pdist` was easiest to implement using `triu_indices`
so I added that one and the related functions as well.
~~In the end, I changed the `pdist` implementation to not use `triu_indices`
but kept the other refs.~~
Pull Request resolved: https://github.com/pytorch/pytorch/pull/82819
Approved by: https://github.com/ngimel