jonasrauber / eagerpy

PyTorch, TensorFlow, JAX and NumPy — all of them natively using the same code
https://eagerpy.jonasrauber.de
MIT License
693 stars 39 forks source link

Add inverse function #48

Closed sandrlom closed 2 years ago

sandrlom commented 2 years ago

First, thank you for providing this framework. This PR proposes the inv function which computes the inverse of an invertible matrix. Let me know if you'd like something changed.

jonasrauber commented 2 years ago

@sandrlom Thanks! Looks great so far. The only problem is that we still need proper tests. They currently fail because inv gets called with 1-dimensional array/tensor. Please include a non-trivial example (not just an identity-matrix).

jonasrauber commented 2 years ago

@sandrlom Thanks! Tests fail because of formatting issues (please reformat the code using black / manually fix the issues reported by flake8).

Once tests pass, let's get this merged :)

codecov[bot] commented 2 years ago

Codecov Report

Merging #48 (1578b94) into master (e593fda) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #48   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           16        16           
  Lines         1860      1870   +10     
=========================================
+ Hits          1860      1870   +10     
Impacted Files Coverage Δ
eagerpy/tensor/tensor.py 100.00% <ø> (ø)
eagerpy/framework.py 100.00% <100.00%> (ø)
eagerpy/tensor/jax.py 100.00% <100.00%> (ø)
eagerpy/tensor/numpy.py 100.00% <100.00%> (ø)
eagerpy/tensor/pytorch.py 100.00% <100.00%> (ø)
eagerpy/tensor/tensorflow.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update e593fda...1578b94. Read the comment docs.

jonasrauber commented 2 years ago

Thanks @sandrlom