Skip to content

Commit

Permalink
deserialize uint
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelDkhn committed Dec 23, 2023
1 parent f1d5350 commit 215a4bc
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion osiris/cairo/serde/deserialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ def deserializer(serialized: list, data_type: str, fp_impl='FP16x16'):
:param fp_impl: The implementation detail, used for fixed-point deserialization.
:return: The deserialized data.
"""
if data_type == 'signed_int':
if data_type == 'unsigned_int':
return deserialize_unsigned_int(serialized)
elif data_type == 'signed_int':
return deserialize_signed_int(serialized)
elif data_type == 'fixed_point':
return deserialize_fixed_point(serialized, fp_impl)
Expand Down Expand Up @@ -43,6 +45,13 @@ def deserializer(serialized: list, data_type: str, fp_impl='FP16x16'):
else:
raise ValueError(f"Unknown data type: {data_type}")

# ================= UNSIGNED INT =================


def deserialize_unsigned_int(serialized: list) -> np.int64:
return np.int64(serialized[0])


# ================= SIGNED INT =================


Expand Down

0 comments on commit 215a4bc

Please sign in to comment.