Skip to content

Commit

Permalink
create tensor with unsigned integers
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelDkhn committed Dec 23, 2023
1 parent 54a4257 commit fac6987
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion osiris/cairo/serde/data_structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ def create_tensor_from_array(arr: np.ndarray, fp_impl='FP16x16'):
tensor_data = []

for value in flat_array:
if isinstance(value, (int, np.integer, np.signedinteger)):
if isinstance(value, (np.unsignedinteger)):
tensor_data.append(value)
elif isinstance(value, (int, np.integer, np.signedinteger)):
sign = 0 if value >= 0 else 1
tensor_data.append(SignedInt(abs(value), sign))
elif isinstance(value, (float, np.floating)):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "giza-osiris"
version = "0.1.3"
version = "0.1.4"
description = "Osiris is a Python library designed for efficient data conversion and management, primarily transforming data into Cairo programs"
authors = ["Fran Algaba <fran@gizatech.xyz>"]
readme = "README.md"
Expand Down

0 comments on commit fac6987

Please sign in to comment.