Skip to content

Commit

Permalink
Adds unique_id property to SparseCoreStackedTableTrackable
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 585365755
  • Loading branch information
tensorflower-gardener committed Nov 26, 2023
1 parent 0a95eea commit d308eb6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tensorflow/python/tpu/tpu_embedding_v3_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,12 @@ def __init__(self, stacked_layouts, table_to_config):
shape=variable_shape,
dtype=dtypes.float32,
)
# TODO(b/312743130): This is a workaround. During checkpoint restoration
# optimizer expects the trackable to provide a `_unique_id` or equivalent.
# Remove this when the bug is fixed.
@property
def _unique_id(self):
return self.vars[self._stacked_layouts[0].table_name]._unique_id

def _serialize_to_tensors(self) -> Any:
return {
Expand Down

0 comments on commit d308eb6

Please sign in to comment.