Skip to content

Fix TCN tuple schema unwrap - #1212

Open
fbonc wants to merge 2 commits into
sunlabuiuc:masterfrom
fbonc:fix-tcn-tuple-schema-unwrap
Open

Fix TCN tuple schema unwrap#1212
fbonc wants to merge 2 commits into
sunlabuiuc:masterfrom
fbonc:fix-tcn-tuple-schema-unwrap

Conversation

@fbonc

@fbonc fbonc commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Issue

TCN.forward passed the raw kwargs dict straight to the embedding model (tcn.py:309). Tuple-schema features such as StageNetProcessor arrive as a tuple (time, value), so the embedding model received a tuple and crashed with "'tuple' object has no attribute 'to'". Every sibling sequence model (RNN, CNN, MLP, Transformer, Deepr, MICRON) unwraps the tuple and extracts the value tensor first, so TCN alone was broken for these inputs.

Fix

Before calling the embedding model, TCN now builds an inputs dict by extracting the "value" tensor (and optional "mask") from each feature using the processor's schema(), mirroring RNN. Plain tensor features are wrapped as a one-element tuple so the same schema lookup applies. This leaves the existing sequence/tensor behavior unchanged (their schema is ("value",)) while fixing tuple-schema features.

Notes

Added regression test test_model_with_stagenet_tuple_feature in tests/core/test_tcn.py.

fbonc added 2 commits August 26, 2026 23:02
TCN passed raw kwargs (with tuple features) to the embedding model,
crashing on StageNetProcessor's (time, value) tuples. Unwrap the 'value'
tensor via the processor schema first, like the sibling sequence models.
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