Skip to content

arrayfire imax function #260

Open
Open

Description

@arilevitas

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.

Activity

  1. syurkevi commented on Feb 1, 2023

    @syurkevi
    Contributor

    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 🙏

  2. arilevitas commented on Feb 1, 2023

    @arilevitas
    Author

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions