Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ script:
- python tests/test_mnist_simple.py
- python tests/test_reuse_mlp.py
- python tests/test_layers_basic.py
- python tests/test_layers_convolutional.py
- python tests/test_layers_convolution.py
- python tests/test_layers_core.py
- python tests/test_layers_extend.py
- python tests/test_layers_flow_control.py
Expand Down
19 changes: 3 additions & 16 deletions tensorlayer/layers/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,24 +371,11 @@ def __init__(self, layer=None, name='layer'):
self.all_params = list(layer.all_params)
self.all_drop = dict(layer.all_drop)
elif isinstance(layer, list): # 2. for layer have multiply inputs i.e. ConcatLayer
# add 1st layer
self.all_layers = list(layer[0].all_layers)
self.all_params = list(layer[0].all_params)
self.all_drop = dict(layer[0].all_drop)
# add other layers
for i in range(1, len(layer)):
self.all_layers.extend(list(layer[i].all_layers))
self.all_params.extend(list(layer[i].all_params))
self.all_drop.update(dict(layer[i].all_drop))
# remove repeated stuff
self.all_layers = list_remove_repeat(self.all_layers)
self.all_params = list_remove_repeat(self.all_params)
self.all_layers = list_remove_repeat(sum([l.all_layers for l in layer], []))
self.all_params = list_remove_repeat(sum([l.all_params for l in layer], []))
self.all_drop = dict(sum([list(l.all_drop.items()) for l in layer], []))
elif isinstance(layer, tf.Tensor):
raise Exception("Please use InputLayer to convert Tensor/Placeholder to TL layer")
self.all_layers = []
self.all_params = []
self.all_drop = {}

elif layer is not None:
raise Exception("Unsupport layer type %s" % type(layer))

Expand Down
1 change: 1 addition & 0 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
yapf==0.20.2
pydocstyle==2.1.1
keras==2.1.5