Skip to content

Remove dead pre-2.0 VAE and Graph_TorchvisionModel - #1210

Open
fbonc wants to merge 1 commit into
sunlabuiuc:masterfrom
fbonc:fix-vae-graphtorchvision-stale-init
Open

Remove dead pre-2.0 VAE and Graph_TorchvisionModel#1210
fbonc wants to merge 1 commit into
sunlabuiuc:masterfrom
fbonc:fix-vae-graphtorchvision-stale-init

Conversation

@fbonc

@fbonc fbonc commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Issue

VAE (vae.py) and Graph_TorchvisionModel (graph_torchvision_model.py) call BaseModel.__init__ with the pre-2.0 signature (dataset, feature_keys, label_key, mode), but the current BaseModel.__init__ accepts only dataset. Instantiating either class therefore always raises TypeError, so both are unusable. They are pre-2.0 dead code: beyond the constructor, Graph_TorchvisionModel also calls get_label_tokenizer(), get_output_size(tokenizer), and prepare_labels(), none of which exist on the current BaseModel. Both classes are exported from pyhealth.models but referenced nowhere in the library or test suite.

Fix

Removed the two dead modules (pyhealth/models/vae.py, pyhealth/models/graph_torchvision_model.py) and their exports in pyhealth/models/__init__.py. Also removed the now-dangling VAE autodoc page (docs/api/models/pyhealth.models.VAE.rst) and its toctree entry in docs/api/models.rst, which would otherwise break the docs build.

Notes

Two example files still reference the removed classes: examples/cxr/chextXray_image_generation_VAE.py and examples/graph_torchvision_model.ipynb. They were already non-functional (their models could never be constructed) and were left in place to keep this change scoped to the dead library code; porting or removing those examples is recommended follow-up. Historical mentions in docs/log.rst (changelog) and docs/tutorials.rst (example listing) were intentionally left untouched as they are historical records and do not break the build. No other unrelated issues were discovered.

Both call BaseModel.__init__ with the pre-2.0 (dataset, feature_keys,
label_key, mode) signature and always raise TypeError on construction;
they also use other removed pre-2.0 APIs and are referenced nowhere in
the library or tests. Remove the modules, their exports, and the dangling
VAE autodoc page.
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