Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ def __init__(self,
'Please initialize `Cluster` layer with a '
'`Layer` instance. You passed: {input}'.format(input=layer))

if 'name' not in kwargs:
kwargs['name'] = self._make_layer_name(layer)

if isinstance(layer, clusterable_layer.ClusterableLayer):
# A user-defined custom layer
super(ClusterWeights, self).__init__(layer, **kwargs)
Expand Down Expand Up @@ -133,6 +136,10 @@ def __init__(self,
and hasattr(layer, '_batch_input_shape'):
self._batch_input_shape = self.layer._batch_input_shape

@staticmethod
def _make_layer_name(layer):
return '{}_{}'.format('cluster', layer.name)

@staticmethod
def _weight_name(name):
"""Extracts the weight name from the full TensorFlow variable name.
Expand Down