Skip to content

Commit

Permalink
Get default type from variable scope.
Browse files Browse the repository at this point in the history
Signed-off-by: Lyaction <[email protected]>
  • Loading branch information
Lyaction committed Apr 12, 2024
1 parent d263e40 commit 9091425
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tensorflow/python/ops/kv_variable_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,9 @@ def sparse_read(self, indices, name=None, ev_init_value=None, counts=None):
default_value = ev_init_value
is_use_default_value_tensor = True
else:
default_value = ops.convert_to_tensor(1.0)
from tensorflow.python.ops import variable_scope
default_type = variable_scope.get_variable_scope().dtype
default_value = ops.convert_to_tensor(1.0, dtype=default_type)
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 9091425

Please sign in to comment.