提交 adfeaaf4 authored 作者: Brandon T. Willard's avatar Brandon T. Willard

Make get_scalar_constant_value compatible with NoneTypes

上级 0e0f613f
...@@ -470,7 +470,10 @@ def get_scalar_constant_value( ...@@ -470,7 +470,10 @@ def get_scalar_constant_value(
data = v.tag.unique_value data = v.tag.unique_value
else: else:
data = v.data data = v.data
return numpy_scalar(data).copy() if isinstance(data, np.ndarray):
return numpy_scalar(data).copy()
else:
return data
if not only_process_constants and getattr(v, "owner", None) and max_recur > 0: if not only_process_constants and getattr(v, "owner", None) and max_recur > 0:
max_recur -= 1 max_recur -= 1
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论