Avoid COW input materialize in more forward ops (#121070)
Affected operators are: addr, cdist, sparse.sampled_addm, sparse.mm,
matrix_exp, softmax, cross_entropy
Part of #97856
Pull Request resolved: https://github.com/pytorch/pytorch/pull/121070
Approved by: https://github.com/ezyang