mirror of
https://github.com/ml-explore/mlx.git
synced 2025-09-01 04:24:36 +08:00
some fixes (#1281)
This commit is contained in:
@@ -2833,7 +2833,7 @@ void init_ops(nb::module_& m) {
|
||||
nb::kw_only(),
|
||||
"stream"_a = nb::none(),
|
||||
nb::sig(
|
||||
"def pad(a: array, pad_with: Union[int, Tuple[int], Tuple[int, int], List[Tuple[int, int]]], constant_values: Union[scalar, array] = 0, *, stream: Union[None, Stream, Device] = None) -> array"),
|
||||
"def pad(a: array, pad_width: Union[int, Tuple[int], Tuple[int, int], List[Tuple[int, int]]], constant_values: Union[scalar, array] = 0, *, stream: Union[None, Stream, Device] = None) -> array"),
|
||||
R"pbdoc(
|
||||
Pad an array with a constant value
|
||||
|
||||
|
@@ -847,9 +847,10 @@ class TestOps(mlx_tests.MLXTestCase):
|
||||
def test_expm1(self):
|
||||
a = mx.array([-88, -87, 0, 0.5, -0.5, 5, 87, 88, 89, 90])
|
||||
result = mx.expm1(a)
|
||||
expected = np.expm1(a, dtype=np.float32)
|
||||
|
||||
self.assertTrue(np.allclose(result, expected, rtol=1e-5, atol=1e-5))
|
||||
errs = np.seterr(over="ignore")
|
||||
expected = np.expm1(a)
|
||||
np.seterr(over=errs["over"])
|
||||
self.assertTrue(np.allclose(result, expected, rtol=1e-3, atol=1e-4))
|
||||
|
||||
def test_erf(self):
|
||||
inputs = [-5, 0.0, 0.5, 1.0, 2.0, 10.0]
|
||||
|
Reference in New Issue
Block a user