Skip to content

Commit 0e9ae51

Browse files
Copilotnjzjz
andcommitted
Remove redundant tensor handling in to_paddle_tensor function
Co-authored-by: njzjz <9496702+njzjz@users.noreply.github.com>
1 parent a5536ab commit 0e9ae51

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

deepmd/pd/utils/utils.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,6 @@ def to_paddle_tensor(
267267
if xx is None:
268268
return None
269269
assert xx is not None
270-
# Handle PaddlePaddle tensors - clone and move to target device/dtype if needed
271-
if isinstance(xx, paddle.Tensor):
272-
return xx.clone().detach().to(device=DEVICE)
273270
if not isinstance(xx, np.ndarray):
274271
return xx
275272
# Create a reverse mapping of NP_PRECISION_DICT

0 commit comments

Comments
 (0)