mirror of
https://github.com/ml-explore/mlx.git
synced 2025-10-20 01:18:12 +08:00
Switch to nanobind (#839)
* mostly builds * most tests pass * fix circle build * add back buffer protocol * includes * fix for py38 * limit to cpu device * include * fix stubs * move signatures for docs * stubgen + docs fix * doc for compiled function, comments
This commit is contained in:
@@ -1,38 +1,38 @@
|
||||
// Copyright © 2023 Apple Inc.
|
||||
// Copyright © 2023-2024 Apple Inc.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <pybind11/pybind11.h>
|
||||
#include <nanobind/nanobind.h>
|
||||
|
||||
#include "mlx/array.h"
|
||||
#include "python/src/utils.h"
|
||||
|
||||
namespace py = pybind11;
|
||||
namespace nb = nanobind;
|
||||
using namespace mlx::core;
|
||||
|
||||
array mlx_get_item(const array& src, const py::object& obj);
|
||||
void mlx_set_item(array& src, const py::object& obj, const ScalarOrArray& v);
|
||||
array mlx_get_item(const array& src, const nb::object& obj);
|
||||
void mlx_set_item(array& src, const nb::object& obj, const ScalarOrArray& v);
|
||||
array mlx_add_item(
|
||||
const array& src,
|
||||
const py::object& obj,
|
||||
const nb::object& obj,
|
||||
const ScalarOrArray& v);
|
||||
array mlx_subtract_item(
|
||||
const array& src,
|
||||
const py::object& obj,
|
||||
const nb::object& obj,
|
||||
const ScalarOrArray& v);
|
||||
array mlx_multiply_item(
|
||||
const array& src,
|
||||
const py::object& obj,
|
||||
const nb::object& obj,
|
||||
const ScalarOrArray& v);
|
||||
array mlx_divide_item(
|
||||
const array& src,
|
||||
const py::object& obj,
|
||||
const nb::object& obj,
|
||||
const ScalarOrArray& v);
|
||||
array mlx_maximum_item(
|
||||
const array& src,
|
||||
const py::object& obj,
|
||||
const nb::object& obj,
|
||||
const ScalarOrArray& v);
|
||||
array mlx_minimum_item(
|
||||
const array& src,
|
||||
const py::object& obj,
|
||||
const nb::object& obj,
|
||||
const ScalarOrArray& v);
|
||||
|
Reference in New Issue
Block a user