Skip to content

Conversation

copybara-service[bot]
Copy link

Fix a bug impacting serialization order for call methods with mutiple inputs.

This bug made get_config/from_config and to_json/from_json not idempotent for layers that take multiple inputs in their call method.

When the functional model is constructed and the multiple inputs are passed as positional arguments, the Node object has multiple call_args in a list.

However, by design, serialization only treats the first argument and positional and serializes all the other arguments as keyword arguments. Upon deserialization, the extra arguments are created as keyword arguments. Their order was modified by tf.nest.flatten, which sorts dicts by key.

This change preserves the order of keyword arguments, regardless of keys.

Fixes #795

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Serialized model changes input nodes orders

1 participant