mirror of
https://github.com/ml-explore/mlx.git
synced 2025-12-16 01:49:05 +08:00
Implemented Cholesky on CPU (#1119)
This commit is contained in:
@@ -2093,4 +2093,20 @@ class Inverse : public UnaryPrimitive {
|
||||
void eval(const std::vector<array>& inputs, array& output);
|
||||
};
|
||||
|
||||
class Cholesky : public UnaryPrimitive {
|
||||
public:
|
||||
explicit Cholesky(Stream stream, bool upper)
|
||||
: UnaryPrimitive(stream), upper_(upper) {};
|
||||
|
||||
void eval_cpu(const std::vector<array>& inputs, array& out) override;
|
||||
void eval_gpu(const std::vector<array>& inputs, array& out) override;
|
||||
|
||||
DEFINE_VMAP()
|
||||
DEFINE_PRINT(Cholesky)
|
||||
|
||||
private:
|
||||
void eval(const std::vector<array>& inputs, array& output);
|
||||
bool upper_;
|
||||
};
|
||||
|
||||
} // namespace mlx::core
|
||||
|
||||
Reference in New Issue
Block a user