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

Testing ExactRep #4

Open
bkj opened this issue Sep 9, 2017 · 3 comments
Open

Testing ExactRep #4

bkj opened this issue Sep 9, 2017 · 3 comments

Comments

@bkj
Copy link

bkj commented Sep 9, 2017

Hi All --

I'm playing with implementing some of the ideas here in PyTorch. I was looking at the ExactRep code and (maybe?) found an issue:

>>> np.__version__
'1.13.1'
>>> x = ExactRep(np.array([2.0]))
>>> a = np.array([0.5])
>>> i = 11
>>> 
>>> for _ in range(i):
...     _ = x.div(a)
... 
>>> for _ in range(i):
...     _ = x.mul(a)
... 
>>> x.val
array([-0.00067149])

Presumably, ExactRep should be able to handle this situation, and correctly return 2.0. Any ideas what might be going on? (If i <= 10, the code works as expected.)

Note that to get ExactRep to run I had to change

class BitStore(object):
    def __init__(self, length):
        ...
        self.store = np.array([0L] * length, dtype=object)

to

class BitStore(object):
    def __init__(self, length):
        ...
        self.store = np.array([0L] * length, dtype=long)

otherwise I get the error

TypeError: ufunc 'add' output (typecode 'O') could not be coerced to provided output parameter (typecode 'l') according to the casting rule ''same_kind''
@huriskayis
Copy link

huriskayis commented Jul 7, 2018

We are dealing with the same error now, were you able to solve it ?

@bkj
Copy link
Author

bkj commented Jul 19, 2018

I ended up rewriting some of the functionality in this package at github.com/bkj/mammoth

Can't remember the exact resolution to this problem off the top of my head

@huriskayis
Copy link

Thank you very much, we also fixed the issue with re-writing the some parts of their code.

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

No branches or pull requests

2 participants