diff options
author | TensorFlower Gardener <gardener@tensorflow.org> | 2018-10-02 12:03:31 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-10-02 12:03:31 -0700 |
commit | 7a0ce3c3a24a91c0bd17a681fa0833c9044e9256 (patch) | |
tree | 0e3acb78765606e4054bbdfacea287663c12024d /tensorflow/python/keras | |
parent | b4c23d661228b549186dc82c16ecb22d261becf6 (diff) | |
parent | a73f6277a390c2ad69ddc877139c4c17ea12325b (diff) |
Merge pull request #22126 from ConcurrencyPractitioner:master
PiperOrigin-RevId: 215431884
Diffstat (limited to 'tensorflow/python/keras')
-rw-r--r-- | tensorflow/python/keras/layers/embeddings.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tensorflow/python/keras/layers/embeddings.py b/tensorflow/python/keras/layers/embeddings.py index c6df5f2e26..824a0b069e 100644 --- a/tensorflow/python/keras/layers/embeddings.py +++ b/tensorflow/python/keras/layers/embeddings.py @@ -159,13 +159,15 @@ class Embedding(Layer): else: in_lens = [self.input_length] if len(in_lens) != len(input_shape) - 1: - ValueError('"input_length" is %s, but received input has shape %s' % - (str(self.input_length), str(input_shape))) + raise ValueError('"input_length" is %s, ' + 'but received input has shape %s' % (str( + self.input_length), str(input_shape))) else: for i, (s1, s2) in enumerate(zip(in_lens, input_shape[1:])): if s1 is not None and s2 is not None and s1 != s2: - ValueError('"input_length" is %s, but received input has shape %s' % - (str(self.input_length), str(input_shape))) + raise ValueError('"input_length" is %s, ' + 'but received input has shape %s' % (str( + self.input_length), str(input_shape))) elif s1 is None: in_lens[i] = s2 return (input_shape[0],) + tuple(in_lens) + (self.output_dim,) |