Skip to content

Commit

Permalink
[Embedding] Fix the issue of default_value type mismatch in the EV Ga…
Browse files Browse the repository at this point in the history
…ther op. (#989)

Signed-off-by: Lyaction <[email protected]>
  • Loading branch information
Lyaction authored Apr 18, 2024
1 parent a4489e3 commit 04413cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tensorflow/python/ops/kv_variable_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -858,10 +858,10 @@ def sparse_read(self, indices, name=None, ev_init_value=None, counts=None):
if self._trainable:
tape.variable_accessed(self)
if ev_init_value is not None:
default_value = ev_init_value
default_value = math_ops.cast(ev_init_value, self.dtype)
is_use_default_value_tensor = True
else:
default_value = ops.convert_to_tensor(1.0)
default_value = ops.convert_to_tensor(1.0, dtype=self.dtype)
is_use_default_value_tensor = False
if counts != None:
value = gen_kv_variable_ops.kv_resource_gather_v1(self._handle,
Expand Down

0 comments on commit 04413cf

Please sign in to comment.