Skip to content

Fix sample(do=...) to follow the model dtype#27

Merged
oduerr merged 1 commit into
mainfrom
fix/sample-do-dtype
Jul 2, 2026
Merged

Fix sample(do=...) to follow the model dtype#27
oduerr merged 1 commit into
mainfrom
fix/sample-do-dtype

Conversation

@oduerr

@oduerr oduerr commented Jul 2, 2026

Copy link
Copy Markdown
Member

torch.full defaulted to float32, crashing sample(do=...) on a float64 model (flow.double(), e.g. for tight cross-implementation parity checks). Follow self._dtype like every other value tensor.

Found by the float64 parity tests of the JAX Bayesian twin in tramdag-simu (tensorchiefs/tramdag-simu branch feat/bayes-jax, PR to follow) — that work depends on this fix, so please merge this first; the sibling checkout there is pinned to this branch until then.

🤖 Generated with Claude Code

https://claude.ai/code/session_01H1WDjRpYVvCvFG99Lirnsi

torch.full defaulted to float32, crashing sampling under do on a
float64 model (flow.double(), e.g. for tight cross-implementation
parity checks). Follow self._dtype like every other value tensor.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H1WDjRpYVvCvFG99Lirnsi
@oduerr oduerr merged commit 60e2479 into main Jul 2, 2026
2 checks passed
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