Skip to content

Commit

Permalink
Creates non-breaking changes where necessary in preparation for switc…
Browse files Browse the repository at this point in the history
…hing all of Keras to new serialization format.

PiperOrigin-RevId: 519076347
  • Loading branch information
Xhark authored and tensorflower-gardener committed Mar 24, 2023
1 parent 63a113d commit e16d463
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,18 @@ def get_config(self):
"""Returns the config used to serialize `QuantizeConfig`."""
raise NotImplementedError('QuantizeConfig should implement get_config().')

@classmethod
def from_config(cls, config):
"""Instantiates a `QuantizeConfig` from its config.
Args:
config: Output of `get_config()`.
Returns:
A `QuantizeConfig` instance.
"""
return cls(**config)


class OutputOnlyConfig(QuantizeConfig):
"""QuantizeConfig that only quantizes output."""
Expand Down

0 comments on commit e16d463

Please sign in to comment.