mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-09 03:55:04 -05:00
feat: warn possible problematic usage of astype
This commit is contained in:
@@ -477,10 +477,16 @@ class Tracer:
|
||||
"""
|
||||
|
||||
normalized_dtype = np.dtype(dtype)
|
||||
output_dtype = Value.of(normalized_dtype.type(0)).dtype
|
||||
if normalized_dtype != np.int64:
|
||||
print(
|
||||
"Warning: when using `value.astype(newtype)`, "
|
||||
"only use `np.int64` as the newtype "
|
||||
"to avoid unexpected overflows "
|
||||
"during inputset evaluation"
|
||||
)
|
||||
|
||||
output_value = deepcopy(self.output)
|
||||
output_value.dtype = output_dtype
|
||||
output_value.dtype = Value.of(normalized_dtype.type(0)).dtype
|
||||
|
||||
computation = Node.generic(
|
||||
"astype",
|
||||
|
||||
Reference in New Issue
Block a user