torch.utils.交换张量¶ torch.utils.swap_tensors(t1, t2)[源代码]¶ 此函数交换两个 Tensor 对象的内容。 从高层次来看,这将使 t1 拥有 t2 的内容,同时保留其身份。 如果 t1 和 t2 具有不同的插槽,这将不起作用。