Skip to content

Commit

Permalink
Replace set with ObjectIdentitySet to prepare for eq change in TF
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 262303233
  • Loading branch information
TensorFlow Hub Authors authored and arnoegw committed Aug 8, 2019
1 parent 9662e48 commit a4ade2f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tensorflow_hub/keras_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ def __init__(self, handle, trainable=False, arguments=None, **kwargs):
if hasattr(self._func, "trainable_variables"):
for v in self._func.trainable_variables:
self._add_existing_weight(v, trainable=True)
trainable_variables = set(self._func.trainable_variables)
trainable_variables = {id(v) for v in self._func.trainable_variables}
else:
trainable_variables = set()
trainable_variables = {}
if hasattr(self._func, "variables"):
for v in self._func.variables:
if v not in trainable_variables:
if id(v) not in trainable_variables:
self._add_existing_weight(v, trainable=False)

# Forward the callable's regularization losses (if any).
Expand Down

0 comments on commit a4ade2f

Please sign in to comment.