Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clamp_min does not handle -inf correctly on Autodiff<NdArray> backend #1757

Open
Karuso33 opened this issue May 12, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@Karuso33
Copy link

The following code

    let x: Tensor<Autodiff<NdArray>, 1> = Tensor::from_floats([f32::NEG_INFINITY], &Default::default())
        .clamp_min(-1e8);
    assert!(x.into_scalar() >= -1e8);

currently panics (even though it clearly should not). Note that this does work correctly when Autodiff<NdArray> is replaced by either Autodiff<Wgpu> or by just NdArray.

I would expect clamp and clamp_max to have similar issues, but I have not tested it.

@antimora antimora added the bug Something isn't working label May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants