Remove useless hasattr check in Layer.get_config.
The hasattr(self, 'dtype') check would only fail if super().__init__ is not called. If not called, Layer.get_config and most other methods already raise errors anyway. PiperOrigin-RevId: 288333917 Change-Id: I1962be09c9c4686c76120298411f3156b561f734
This commit is contained in:
parent
7f304cc3ef
commit
e19c92334c
@ -487,10 +487,7 @@ class Layer(module.Module):
|
||||
config = {'name': self.name, 'trainable': self.trainable}
|
||||
if hasattr(self, '_batch_input_shape'):
|
||||
config['batch_input_shape'] = self._batch_input_shape
|
||||
# TODO(reedwm): Remove the hasattr(self, 'dtype') check. All layers have a
|
||||
# dtype.
|
||||
if hasattr(self, 'dtype'):
|
||||
config['dtype'] = policy.serialize(self._dtype_policy)
|
||||
config['dtype'] = policy.serialize(self._dtype_policy)
|
||||
if hasattr(self, 'dynamic'):
|
||||
# Only include `dynamic` in the `config` if it is `True`
|
||||
if self.dynamic:
|
||||
|
Loading…
Reference in New Issue
Block a user