mirror of
https://github.com/ml-explore/mlx.git
synced 2025-12-14 09:07:12 +08:00
implemented Flatten Module (#149)
* implemented flatten op --------- Co-authored-by: Awni Hannun <awni@apple.com>
This commit is contained in:
@@ -728,6 +728,21 @@ void init_array(py::module_& m) {
|
||||
return power(a, to_array(v, a.dtype()));
|
||||
},
|
||||
"other"_a)
|
||||
.def(
|
||||
"flatten",
|
||||
[](const array& a,
|
||||
int start_axis,
|
||||
int end_axis,
|
||||
const StreamOrDevice& s) {
|
||||
return flatten(a, start_axis, end_axis);
|
||||
},
|
||||
"start_axis"_a = 0,
|
||||
"end_axis"_a = -1,
|
||||
py::kw_only(),
|
||||
"stream"_a = none,
|
||||
R"pbdoc(
|
||||
See :func:`flatten`.
|
||||
)pbdoc")
|
||||
.def(
|
||||
"reshape",
|
||||
[](const array& a, py::args shape, StreamOrDevice s) {
|
||||
|
||||
Reference in New Issue
Block a user