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

Add numpy types on type system #40

Closed
guilhermeleobas opened this issue Mar 2, 2020 · 1 comment · Fixed by #41
Closed

Add numpy types on type system #40

guilhermeleobas opened this issue Mar 2, 2020 · 1 comment · Fixed by #41
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@guilhermeleobas
Copy link
Contributor

The following code fails:

@rjit('double(double, double)')
    def logaddexp(x, y):
        return np.logaddexp(x, y)

x = np.log(1e-50)
y = np.log(2.5e-50)
logaddexp(x, y)
...
rbc/tests/test_numpy_rjit.py:50:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
rbc/remotejit.py:261: in __call__
    atypes = tuple(Type.fromvalue(a, target_info) for a in arguments)
rbc/remotejit.py:261: in <genexpr>
    atypes = tuple(Type.fromvalue(a, target_info) for a in arguments)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

cls = <class 'rbc.typesystem.Type'>, obj = -115.12925464970229, target_info = <rbc.targetinfo.TargetInfo object at 0x10c5766d0>

    @classmethod
    def fromvalue(cls, obj, target_info):
        """Return Type instance that corresponds to given Python value.
        """
        n = _python_imap.get(type(obj))
        print(type(obj))
        if n is not None:
            return cls.fromstring(n, target_info)
>       raise NotImplementedError('%s.fromvalue(%r)'
                                  % (cls.__name__, obj))
E       NotImplementedError: Type.fromvalue(-115.12925464970229)

rbc/typesystem.py:751: NotImplementedError

x and y have types numpy.float64.

@pearu
Copy link
Contributor

pearu commented Mar 2, 2020

See #39 (comment)

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

Successfully merging a pull request may close this issue.

2 participants