mirror of
https://github.com/ml-explore/mlx.git
synced 2025-12-16 01:49:05 +08:00
CPU mx.linalg.cholesky_inverse and mx.linalg.tri_inv (#1307)
* add cholesky inv + tri inv * always run tri_inv on cpu * consistent naming
This commit is contained in:
@@ -2127,7 +2127,8 @@ class SVD : public Primitive {
|
||||
/* Matrix inversion primitive. */
|
||||
class Inverse : public UnaryPrimitive {
|
||||
public:
|
||||
explicit Inverse(Stream stream) : UnaryPrimitive(stream) {}
|
||||
explicit Inverse(Stream stream, bool tri, bool upper)
|
||||
: UnaryPrimitive(stream), tri_(tri), upper_(upper) {}
|
||||
|
||||
void eval_cpu(const std::vector<array>& inputs, array& output) override;
|
||||
void eval_gpu(const std::vector<array>& inputs, array& output) override;
|
||||
@@ -2137,6 +2138,8 @@ class Inverse : public UnaryPrimitive {
|
||||
|
||||
private:
|
||||
void eval(const std::vector<array>& inputs, array& output);
|
||||
bool tri_;
|
||||
bool upper_;
|
||||
};
|
||||
|
||||
class Cholesky : public UnaryPrimitive {
|
||||
|
||||
Reference in New Issue
Block a user