Skip to content

Commit

Permalink
Edit
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammadnaseri committed Sep 19, 2024
1 parent d81c58d commit f3caa4f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/py/flwr/common/serde.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,12 +424,11 @@ def _record_value_to_proto(
# Note: `isinstance(False, int) == True`.
if isinstance(value, t):
if t == int:
value = int(value)
# Handle int values for sint64 and uint64
if value < 0:
arg[_type_to_field[t]] = value + (1 << 64)
arg[_type_to_field[t]] = value + (1 << 64) # type: ignore[operator]
else:
arg[_type_to_field[t]] = value
arg[_type_to_field[t]] = value # type: ignore[operator]

arg[_type_to_field[t]] = value
return proto_class(**arg)
Expand Down

0 comments on commit f3caa4f

Please sign in to comment.