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

arrayfire imax function #260

Open
arilevitas opened this issue Feb 1, 2023 · 2 comments
Open

arrayfire imax function #260

arilevitas opened this issue Feb 1, 2023 · 2 comments

Comments

@arilevitas
Copy link

max_val, max_idx = af.imax(img)

running this function seems to have wrong behavior and finds wrong max value for an image with pixels in range [0,1].

When running max_val, max_idx = af.imax(af.flat(img)) the correct max value is found.

@syurkevi
Copy link
Contributor

syurkevi commented Feb 1, 2023

I'm having trouble reproducing this with various backends and image sizes.

af.info()
af.set_backend('opencl')
img = af.randu(3,3)
max_val, max_idx = af.imax(img)
max_valf, max_idxf = af.imax(af.flat(img))
print(img)
print(max_val)
print(max_idx)
print(max_valf)
print(max_idxf)
#####
[3 3 1 1]
    0.3688     0.1266     0.4220 
    0.2578     0.6511     0.2491 
    0.3815     0.4507     0.4128 


0.6511174440383911
4
0.6511174440383911
4

This is with the latest wheels. Can you provide more info what system/gpu/release/backend/OS/driver version/python version you're seeing the wrong behavior? Sample data or a minimal reproducible code snippet would be appreciated as well 🙏

@arilevitas
Copy link
Author

arilevitas commented Feb 1, 2023

image

Let me know if this is helped
arrayfire version: 3.6.20181017

[[0.07369253, 0.06271768, 0.05245196],
[0.08713178, 0.07496584, 0.06345784],
[0.10122371, 0.08787344, 0.07517199]]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants