clone
() → Tensor
- 反向传播时,将会返回到原来的变量上
Returns a copy of theself
tensor. The copy has the same size and data type asself
. - NOTE
- Unlike copy_(), this function is recorded in the computation graph. Gradients propagating to the cloned tensor will propagate to the original tensor.
copy_
(src, non_blocking=False) → Tensor
-
只是值得复制
Copies the elements fromsrc
intoself
tensor and returnsself
. -
The
src
tensor must be broadcastable with theself
tensor. It may be of a different data type or reside on a different device.
近期评论