@Prashant
I am not aware of c10::Tuple in our code base (or do you mean c10::Ivalue::Tuple?) . We do have TupleType and TupleTypePtr.
I assume you use it as an example. Normally, the implementation of these c10 types are located in
c10/utils or aten/src/ATen/core, you can search the implementation there.
If you are talking about Ivalue::Tuple (or any types under Ivalue), take a look at here:
‘pytorch/ivalue.h at 5741de883af2ac63cec537fc8a554610a5cea853 · pytorch/pytorch · GitHub’
If you don’t call deepCopy, I believe there will be no value copy (buy swap) happen.