From e72c682fbb8c117f8e2f2c255c3b69f1f79ec9ee Mon Sep 17 00:00:00 2001 From: Sam Skalicky Date: Mon, 4 May 2020 17:18:39 +0000 Subject: [PATCH 1/2] fixed overwrite of args/aux variables --- python/mxnet/symbol/symbol.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/python/mxnet/symbol/symbol.py b/python/mxnet/symbol/symbol.py index 37b91867f84c..0bbbc1f29689 100644 --- a/python/mxnet/symbol/symbol.py +++ b/python/mxnet/symbol/symbol.py @@ -1484,17 +1484,17 @@ def optimize_for(self, backend, args=None, aux=None, ctx=None, **kwargs): assert isinstance(backend, str) if args is None or len(args) == 0: - args = [] + args_ = [] args_handle = c_array(NDArrayHandle, []) else: - args_handle, args = self._get_ndarray_inputs('args', args, + args_handle, args_ = self._get_ndarray_inputs('args', args, self.list_arguments(), False) if aux is None or len(aux) == 0: - aux = [] + aux_ = [] aux_handle = c_array(NDArrayHandle, []) else: - aux_handle, aux = self._get_ndarray_inputs('aux_states', aux, + aux_handle, aux_ = self._get_ndarray_inputs('aux_states', aux, self.list_auxiliary_states(), False) if ctx is None: ctx = current_context() @@ -1516,9 +1516,9 @@ def optimize_for(self, backend, args=None, aux=None, ctx=None, **kwargs): c_str(backend), ctypes.c_int(ctx.device_typeid), ctypes.byref(out), - mx_uint(len(args)), + mx_uint(len(args_)), args_handle, - mx_uint(len(aux)), + mx_uint(len(aux_)), aux_handle, mx_uint(len(key_list)), c_str_array(key_list), From e86acd975f5860f77f5e2150ab9c5b47de4cab4d Mon Sep 17 00:00:00 2001 From: Sam Skalicky Date: Mon, 4 May 2020 17:38:39 +0000 Subject: [PATCH 2/2] fixed spacing --- python/mxnet/symbol/symbol.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/mxnet/symbol/symbol.py b/python/mxnet/symbol/symbol.py index 0bbbc1f29689..e90fb9b31e36 100644 --- a/python/mxnet/symbol/symbol.py +++ b/python/mxnet/symbol/symbol.py @@ -1488,14 +1488,14 @@ def optimize_for(self, backend, args=None, aux=None, ctx=None, **kwargs): args_handle = c_array(NDArrayHandle, []) else: args_handle, args_ = self._get_ndarray_inputs('args', args, - self.list_arguments(), False) + self.list_arguments(), False) if aux is None or len(aux) == 0: aux_ = [] aux_handle = c_array(NDArrayHandle, []) else: aux_handle, aux_ = self._get_ndarray_inputs('aux_states', aux, - self.list_auxiliary_states(), False) + self.list_auxiliary_states(), False) if ctx is None: ctx = current_context() assert isinstance(ctx, Context)