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

update transposition to latest torch convention #446

Merged
merged 3 commits into from Apr 24, 2023

Conversation

matthieutrs
Copy link
Contributor

@matthieutrs matthieutrs commented Apr 21, 2023

Updating a transposition to latest torch convention that was raising a deprecation warning message at each call of the transform and clogging training logs.

The warning was:

The use of `x.T` on tensors of dimension other than 2 to reverse their shape is deprecated and it will 
throw an error in a future release. Consider `x.mT` to transpose batches of matrices or 
`x.permute(*torch.arange(x.ndim - 1, -1, -1))` to reverse the dimensions of a tensor.

This PR implements precisely the second suggestion. I couldn't find any other use of .T in the repo but I'd happily update if you point me to others :)

@bruAristimunha
Copy link
Collaborator

Nice!

Thank you very much for your PR! Could you register your modification in the what's news file for you to be listed as contributors?

https://raw.githubusercontent.com/braindecode/braindecode/master/docs/whats_new.rst

@codecov
Copy link

codecov bot commented Apr 21, 2023

Codecov Report

Merging #446 (6b33ad9) into master (c2a8312) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #446   +/-   ##
=======================================
  Coverage   84.11%   84.11%           
=======================================
  Files          59       59           
  Lines        4268     4269    +1     
=======================================
+ Hits         3590     3591    +1     
  Misses        678      678           

@matthieutrs
Copy link
Contributor Author

Sure @bruAristimunha! I've updated

@bruAristimunha bruAristimunha merged commit 57e384d into braindecode:master Apr 24, 2023
5 checks passed
@bruAristimunha
Copy link
Collaborator

Thank you @matthieutrs

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

Successfully merging this pull request may close these issues.

None yet

2 participants