Skip to content

Commit

Permalink
Update keras/premade/linear.py error message to use f-strings inste…
Browse files Browse the repository at this point in the history
…ad of `.format()`

PiperOrigin-RevId: 391283357
  • Loading branch information
LukeWood authored and tensorflower-gardener committed Aug 17, 2021
1 parent 894501a commit 3df49f8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions keras/premade/linear.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,11 @@ def call(self, inputs):
different_keys = set(names) - set(inputs.keys())
if different_keys:
raise ValueError(
'The input dictionary does not match '
'The `inputs` dictionary does not match '
'the structure expected by the model.'
'\n\tExpected keys: {}'
'\n\tReceived keys: {}'
'\n\tMissing keys: {}'.format(set(names), set(inputs.keys()),
different_keys))
f'\n\tExpected keys: {set(names)}'
f'\n\tReceived keys: {set(inputs.keys())}'
f'\n\tMissing keys: {different_keys}')
inputs = [inputs[name] for name in names]
for inp, layer in zip(inputs, self.dense_layers):
output = layer(inp)
Expand Down

0 comments on commit 3df49f8

Please sign in to comment.