Skip to content

[bugfix] add missing detach() before numpy() in predict pipeline#434

Open
tiankongdeguiji wants to merge 2 commits intoalibaba:masterfrom
tiankongdeguiji:fix/main-detach-before-numpy
Open

[bugfix] add missing detach() before numpy() in predict pipeline#434
tiankongdeguiji wants to merge 2 commits intoalibaba:masterfrom
tiankongdeguiji:fix/main-detach-before-numpy

Conversation

@tiankongdeguiji
Copy link
Collaborator

Summary

  • Added .detach() before .numpy() calls in the prediction pipeline in tzrec/main.py
  • Without this, a RuntimeError would be raised if tensors have requires_grad=True

Test plan

  • Run prediction pipeline to verify output is unchanged
  • Verify no RuntimeError on tensors with gradients

🤖 Generated with Claude Code

tiankongdeguiji and others added 2 commits March 22, 2026 10:56
Tensors must be detached from the computation graph before converting
to numpy arrays. Without detach(), a RuntimeError is raised if any
tensor has requires_grad=True.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant