diff options
author | 2018-09-22 10:57:06 -0700 | |
---|---|---|
committer | 2018-09-22 10:57:06 -0700 | |
commit | 425e96f3ae4eb338268e3738260f9d79e4bdd893 (patch) | |
tree | 9378c76d616c776f93b177d3273dbb34232f1c78 /tensorflow/contrib/layers | |
parent | 1a8dd7910eedfea6ba1917c8055fcd7fed9b157e (diff) | |
parent | ba5d214a6b5d131b693eff277cc3b56298a4721a (diff) |
Merge pull request #20539 from candyzone:master
PiperOrigin-RevId: 214121495
Diffstat (limited to 'tensorflow/contrib/layers')
-rw-r--r-- | tensorflow/contrib/layers/python/layers/embedding_ops.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tensorflow/contrib/layers/python/layers/embedding_ops.py b/tensorflow/contrib/layers/python/layers/embedding_ops.py index 60e1d85ea9..17ee8c0733 100644 --- a/tensorflow/contrib/layers/python/layers/embedding_ops.py +++ b/tensorflow/contrib/layers/python/layers/embedding_ops.py @@ -112,9 +112,11 @@ 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) - embedding_weights = [ - ops.convert_to_tensor(w, dtype=dtype) for w in embedding_weights - ] + if not isinstance(embedding_weights[0], + resource_variable_ops.ResourceVariable): + embedding_weights = [ + ops.convert_to_tensor(w, dtype=dtype) for w in embedding_weights + ] contrib_tensor_util.assert_same_float_dtype(embedding_weights + [sparse_weights]) |