set_data will shallow-copy all non-autograd TensorImpl fields and will not bump the version counter, if I’m not mistaken. I think the equivalent would be an assignment to the .data attribute in Python, which is not recommended as it might yield unwanted side effects.
The Tensor A = B; operation will create a new tensor pointing to B and should not yield any side effects.