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

Transpose not working after upgrading to 0.6 #407

Closed
LouisMagarshack opened this issue Jun 27, 2017 · 1 comment
Closed

Transpose not working after upgrading to 0.6 #407

LouisMagarshack opened this issue Jun 27, 2017 · 1 comment

Comments

@LouisMagarshack
Copy link

Hi all,

I'm porting some code from ancient 0.4.7 to brand new 0.6 and I ran into the following issue:

transpose([PyObject(1) PyObject(2);
       PyObject(3) PyObject(4)])

Doesn't work anymore, it fails with error:
ERROR: MethodError: no method matching transpose(::PyCall.PyObject).

Should I implement something like transpose(x::PyObject) = x or is there a better solution?

@stevengj
Copy link
Member

0.5 removed the transpose(x) = x fallback, and transpose is recursive. There are lots of discussions about whether to keep this behavior going forward, e.g. JuliaLang/julia#21037.

For now, the right thing is to do permutedims(A, (2,1)) when you just want to swap the dimensions and not call transpose recursively.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants