I think that in this case, the clone() is used to make sure that you have different memory. And so inplace modification of one won’t change the other.
The detach() is use to avoid tracking gradient information between the two so that uses of net_input_saved won’t affect the gradients of net_input.