Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transposing an expression not supported and leads to strange error #5

Open
jonnyhyman opened this issue May 17, 2018 · 0 comments
Open
Labels
bug Something isn't working

Comments

@jonnyhyman
Copy link
Owner

In trying to transpose an atoms.smul instance, I ran into a strange error during the deepcopy phase.

File "c:\users\__jonny__\dropbox\compute\convexoptimization\convex_symbolic\cvx_sym\symbolic.py", line 354, in T
    transpose = copy.deepcopy(self)
  File "C:\Python36-64\lib\copy.py", line 180, in deepcopy
    y = _reconstruct(x, memo, *rv)
  File "C:\Python36-64\lib\copy.py", line 280, in _reconstruct
    state = deepcopy(state, memo)
  File "C:\Python36-64\lib\copy.py", line 150, in deepcopy
    y = copier(x, memo)
  File "C:\Python36-64\lib\copy.py", line 240, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "C:\Python36-64\lib\copy.py", line 150, in deepcopy
    y = copier(x, memo)
  File "C:\Python36-64\lib\copy.py", line 215, in _deepcopy_list
    append(deepcopy(a, memo))
  File "C:\Python36-64\lib\copy.py", line 180, in deepcopy
    y = _reconstruct(x, memo, *rv)
  File "C:\Python36-64\lib\copy.py", line 274, in _reconstruct
    y = func(*args)
  File "C:\Python36-64\lib\copyreg.py", line 88, in __newobj__
    return cls.__new__(cls, *args)
  File "c:\users\__jonny__\dropbox\compute\convexoptimization\convex_symbolic\cvx_sym\operations\atoms\muls.py", line 39, in __new__
    return sym.Constant(args[0].value * args[1].value)
IndexError: tuple index out of range

It appears in doing the deepcopy, the new method was called on the smul and misinterpreted the args as constants.

For now, transpose only symbols directly. In the future, will need to implement a transpose method for functions.

@jonnyhyman jonnyhyman added the bug Something isn't working label May 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant