Skip to content

Conversation

@copybara-service
Copy link

obm: Match TF output signature argument names.

TF SavedModel picks output names based either on their position or the key in the enclosing dictionary. Orbax Model used to use only positional names. This change updates OBM's logic to match TF SavedModel. The biggest difference is that if the TF function returns a dictionary, or an instance of a registered dataclass, OBM will now pick up its keys and use them as output keys names.

This and cl/829521984 should make OBM's TF SavedModel compatible with any tooling that may have depended on the TFSM generated input/output names in SignatureDef.

TF SavedModel picks output names based either on their position or the key in the enclosing dictionary. Orbax Model used to use only positional names. This change updates OBM's logic to match TF SavedModel. The biggest difference is that if the TF function returns a dictionary, or an instance of a registered dataclass, OBM will now pick up its keys and use them as output keys names.

This and cl/829521984 should make OBM's TF SavedModel compatible with any tooling that may have depended on the TFSM generated input/output names in `SignatureDef`.

PiperOrigin-RevId: 830629964
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.

2 participants