Skip to content

Commit

Permalink
Internal change
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 303925062
  • Loading branch information
TensorFlow Hub Authors authored and akhorlin committed Mar 31, 2020
1 parent 2e96d5d commit ba508d9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tensorflow_hub/feature_column.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,9 @@ def parents(self):
def name(self):
"""Returns string. Used for variable_scope and naming."""
if not hasattr(self, "_name"):
self._name = "{}_hub_module_embedding".format(self.key)
key_name = self.key if isinstance(self.key,
six.string_types) else self.key.name
self._name = "{}_hub_module_embedding".format(key_name)
return self._name

def create_state(self, state_manager):
Expand Down
5 changes: 5 additions & 0 deletions tensorflow_hub/feature_column_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,11 @@ def testConfig(self):
image_column = hub.image_embedding_column("image", self.spec)
config = image_column.get_config()

def testName(self):
image_column = hub.image_embedding_column(
tf.feature_column.numeric_column("image"), self.spec)
self.assertEqual("image_hub_module_embedding", image_column.name)


class SparseTextEmbeddingColumnTest(tf.test.TestCase):

Expand Down

0 comments on commit ba508d9

Please sign in to comment.