Skip to content
This repository has been archived by the owner on Mar 3, 2024. It is now read-only.

Commit

Permalink
Fix type checking
Browse files Browse the repository at this point in the history
  • Loading branch information
CyberZHG committed Sep 26, 2018
1 parent 35f7bb7 commit a480f83
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions keras_wc_embd/word_char_embd.py
Expand Up @@ -147,11 +147,11 @@ def get_embedding_layer(word_dict_len,
name='Dense_Char',
),
]
elif type(char_hidden_layer_type) is list or isinstance(char_hidden_layer_type, keras.layers.Layer):
elif isinstance(char_hidden_layer_type, list) or isinstance(char_hidden_layer_type, keras.layers.Layer):
char_hidden_layer = char_hidden_layer_type
else:
raise NotImplementedError('Unknown character hidden layer type: %s' % char_hidden_layer_type)
if type(char_hidden_layer) is not list:
if not isinstance(char_hidden_layer, list):
char_hidden_layer = [char_hidden_layer]
for i, layer in enumerate(char_hidden_layer):
if i == len(char_hidden_layer) - 1:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -2,7 +2,7 @@

setup(
name='keras-word-char-embd',
version='0.14',
version='0.15',
packages=['keras_wc_embd'],
url='https://github.com/CyberZHG/keras-word-char-embd',
license='MIT',
Expand Down

0 comments on commit a480f83

Please sign in to comment.