Skip to content

dpctl.tensor.tan returns incorrect result #2031

Open
@antonwolfy

Description

@antonwolfy

It seems dpctl.tensor.tan returns result which differs with numpy and Intel MKL:

import dpnp, numpy, dpctl, dpctl.tensor as dpt

a = numpy.array([11], dtype='F')
numpy.tan(a)
# Out: array([-225.95084+0.j], dtype=complex64)

ia = dpnp.array(a, device='cpu')
dpnp.tan(ia)
# array([-225.95085+0.j], dtype=complex64)  tan() from Intel MKL is used

na = dpt.asarray(a, device='cpu')
dpt.tan(da)
# Out: usm_ndarray([-225.68439+0.j], dtype=complex64)

na = dpt.asarray(a, device='gpu')
dpt.tan(na)
# Out: usm_ndarray([-225.68439+0.j], dtype=complex64)

# casting to complex128 resolve the issue:
na = dpt.asarray(a, device='cpu', dtype='D')
dpt.tan(na)
# Out: usm_ndarray([-225.95084645+0.j])

Is the behavior expected? Or is there something which needs to be fixed in dpctl?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions