Skip to content

dpctl.tensor.logaddexp does not always return nan when one operand is not nan #1321

Closed

Description

@ndgrigorian

For example:

In [1]: import dpctl.tensor as dpt

In [2]: x1, x2 = dpt.asarray(1., dtype=dpt.float64), dpt.asarray(dpt.nan, dtype=dpt.float64)

In [3]: dpt.logaddexp(x1, x2)
Out[3]: usm_ndarray(1.69314718)

In [4]: dpt.logaddexp(x2, x1)
Out[4]: usm_ndarray(nan)

This should return nan in both cases

Activity

  1. self-assigned this
    on Aug 2, 2023
  2. ndgrigorian commented on Aug 3, 2023

    @ndgrigorian
    CollaboratorAuthor

    Another case:

    In [4]: x1 = dpt.asarray(dpt.inf)
    
    In [5]: x2 = dpt.asarray(dpt.inf)
    
    In [6]: dpt.logaddexp(x1, x2)
    Out[6]: usm_ndarray(nan)
    

    Should be dpt.inf

  3. ndgrigorian commented on Aug 9, 2023

    @ndgrigorian
    CollaboratorAuthor

    This issue was resolved in #1324

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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