arrayfire imax function
arilevitas opened this issue · comments
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.
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