Skip to content

Accept native Torch state in ModelCore and CoreSolver.run - #210

Merged
jc-macdonald merged 1 commit into
mainfrom
fix/208-torch-state-dtype
Oct 14, 2026
Merged

jc-macdonald merged 1 commit into
mainfrom
fix/208-torch-state-dtype

Conversation

@jc-macdonald

@jc-macdonald jc-macdonald commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

ModelCore.set_initial_state passed a NumPy dtype to the input namespace, so a native torch.Tensor failed before CoreSolver.run could start. Resolve the configured dtype by name in the input's namespace so the complete run preserves Torch state and history.

Adds CPU Torch CI and regression coverage for float32/float64, fixed RK4/Dormand–Prince, adaptive Dormand–Prince/Heun, and history enabled or disabled. Dtype configuration continues to use NumPy-compatible values, as documented in the backend guide.

Closes #208.

Validation:

  • 17 CPU Torch tests pass on this isolated branch.
  • Ruff preview format/lint, strict core mypy, and strict documentation build pass.
  • GitHub CI passes on the submitted commit: Python 3.11–3.14, CPU Torch, package builds, and documentation.

@jc-macdonald
jc-macdonald merged commit 7637467 into main Oct 14, 2026
7 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.

ModelCore rejects torch.Tensor state: set_initial_state passes a NumPy dtype to torch.asarray

1 participant