Fix lint errors

This commit is contained in:
Allen Lavoie 2018-09-21 15:30:56 -07:00
parent 9bab0c89c4
commit ba5d214a6b
3 changed files with 6 additions and 3 deletions

View File

@ -112,7 +112,8 @@ def safe_embedding_lookup_sparse(embedding_weights,
dtype = sparse_weights.dtype if sparse_weights is not None else None
if isinstance(embedding_weights, variables.PartitionedVariable):
embedding_weights = list(embedding_weights)
if not isinstance(embedding_weights[0], resource_variable_ops.ResourceVariable):
if not isinstance(embedding_weights[0],
resource_variable_ops.ResourceVariable):
embedding_weights = [
ops.convert_to_tensor(w, dtype=dtype) for w in embedding_weights
]

View File

@ -3283,7 +3283,8 @@ def _safe_embedding_lookup_sparse(embedding_weights,
raise ValueError('Missing embedding_weights %s.' % embedding_weights)
dtype = sparse_weights.dtype if sparse_weights is not None else None
if not isinstance(embedding_weights[0], resource_variable_ops.ResourceVariable):
if not isinstance(embedding_weights[0],
resource_variable_ops.ResourceVariable):
embedding_weights = [
ops.convert_to_tensor(w, dtype=dtype) for w in embedding_weights
]

View File

@ -545,7 +545,8 @@ def safe_embedding_lookup_sparse(embedding_weights,
raise ValueError('Missing embedding_weights %s.' % embedding_weights)
dtype = sparse_weights.dtype if sparse_weights is not None else None
if not isinstance(embedding_weights[0], resource_variable_ops.ResourceVariable):
if not isinstance(embedding_weights[0],
resource_variable_ops.ResourceVariable):
embedding_weights = [
ops.convert_to_tensor(w, dtype=dtype) for w in embedding_weights
]