diff --git a/onnxconverter_common/onnx2py.py b/onnxconverter_common/onnx2py.py index 684fa01..89f4a5b 100644 --- a/onnxconverter_common/onnx2py.py +++ b/onnxconverter_common/onnx2py.py @@ -177,7 +177,7 @@ def convert_tensor(tensor): if tensor.data_location == TensorProto.EXTERNAL: return convert_external_tensor(tensor) np_data = numpy_helper.to_array(tensor) - if np.product(np_data.shape) <= 10: + if np.prod(np_data.shape) <= 10: return numpy_helper_traced.from_array(np_data, name=tensor.name) dtype = np_data.dtype if dtype == object: diff --git a/onnxconverter_common/pytracing.py b/onnxconverter_common/pytracing.py index 8134ca6..0f66f27 100644 --- a/onnxconverter_common/pytracing.py +++ b/onnxconverter_common/pytracing.py @@ -22,8 +22,8 @@ class TracingObject: Used by onnx2py to mock a module like numpy or onnx.helper and record calls on that module Ex: np = TracingObject("np") - x = np.array(np.product([1, 2, 3]), np.int32) - assert repr(x) == "np.array(np.product([1, 2, 3]), np.int32)" + x = np.array(np.prod([1, 2, 3]), np.int32) + assert repr(x) == "np.array(np.prod([1, 2, 3]), np.int32)" """ def __init__(self, trace, py_obj=NoPyObjException): self._trace = trace