oxideai / mlx-rs

Unofficial Rust bindings to Apple's mlx framework
https://oxideai.github.io/mlx-rs/
Apache License 2.0
50 stars 4 forks source link

Uncaught exception in `repeat` #70

Open minghuaw opened 3 months ago

minghuaw commented 3 months ago

While working on the macro version of the ops, the following test case was found to yield an exception that was not caught before crossing the ffi boundary

    #[test]
    fn test_repeat() {
        let stream = StreamOrDevice::default();

        // We are just testing that the macros compile
        let a = Array::from_int(5);
        let _a = repeat!(a, 3, 0);

        let a = Array::from_int(5);
        let _a = repeat!(a, 3, 0, stream = &stream);

        let a = Array::from_int(5);
        let _a = repeat!(a, 3, 0, dtype = f32);

        let a = Array::from_int(5);
        let _a = repeat!(a, 3, 0, dtype = f32, stream = &stream);
    }
minghuaw commented 2 months ago

Since we are moving to the new error handling approach. This should not be a problem anymore, but we should add a unit test for this just to be sure before closing this issue