Skip to content

Conversation

@aarmey
Copy link
Contributor

@aarmey aarmey commented Jan 5, 2023

I noticed that the in-place operations here were completely overwriting the existing values, so there wasn't a benefit of keeping this as in-place except maybe reducing allocations. For some backends, such as Jax, in-place operations are extremely slow, and so overall I expect this is both faster and more readable.

@codecov
Copy link

codecov bot commented Jan 5, 2023

Codecov Report

Merging #474 (bb78654) into main (f8033be) will decrease coverage by 1.66%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #474      +/-   ##
==========================================
- Coverage   88.50%   86.83%   -1.67%     
==========================================
  Files         107      120      +13     
  Lines        6404     7461    +1057     
==========================================
+ Hits         5668     6479     +811     
- Misses        736      982     +246     
Impacted Files Coverage Δ
tensorly/decomposition/_parafac2.py 95.27% <100.00%> (+2.62%) ⬆️
tensorly/datasets/tests/test_imports.py 80.76% <0.00%> (-19.24%) ⬇️
tensorly/datasets/data_imports.py 73.13% <0.00%> (-16.42%) ⬇️
tensorly/tenalg/__init__.py 83.72% <0.00%> (-0.73%) ⬇️
tensorly/tr_tensor.py 87.62% <0.00%> (ø)
tensorly/tt_matrix.py 71.42% <0.00%> (ø)
tensorly/tt_tensor.py 75.51% <0.00%> (ø)
tensorly/tucker_tensor.py 83.94% <0.00%> (ø)
tensorly/parafac2_tensor.py 92.06% <0.00%> (ø)
tensorly/decomposition/_nn_cp.py 87.05% <0.00%> (ø)
... and 36 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@JeanKossaifi
Copy link
Member

Thanks @aarmey, looks good to me. I really love changes that make the code more readable, which this does!
Merging.

@JeanKossaifi JeanKossaifi merged commit e59d93a into tensorly:main Jan 10, 2023
@aarmey aarmey deleted the simplify-parafac2 branch January 16, 2023 15:50
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.

2 participants