another path won’t be affected, you’ll have separate graph nodes for each use of tensor, i.e.
x_ng = x.detach()
y1 = x_ng @ m1
y2 = x @ m2
two paths start from x, original x tensor is not effected by detach, and y1 is trainable only through m1