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

dtype promotion rules are not quite right for element-wise ufuncs #89

Closed
shoyer opened this issue Mar 25, 2015 · 0 comments · Fixed by #91
Closed

dtype promotion rules are not quite right for element-wise ufuncs #89

shoyer opened this issue Mar 25, 2015 · 0 comments · Fixed by #91

Comments

@shoyer
Copy link
Member

shoyer commented Mar 25, 2015

Many ufuncs actually always converge this argument to float, e.g., consider:

In [13]: values = np.random.randint(10, size=(4, 6))

In [14]: data = da.from_array(values, blockshape=(2, 2))

In [15]: data.dtype
Out[15]: dtype('int64')

In [16]: da.sin(data).dtype
Out[16]: dtype('int64')

In [17]: da.sin(data).compute()
Out[17]:
array([[ 0.14112001,  0.14112001,  0.14112001,  0.90929743,  0.41211849,
         0.        ],
       [ 0.6569866 ,  0.14112001, -0.2794155 , -0.2794155 ,  0.14112001,
         0.90929743],
       [ 0.        ,  0.90929743,  0.84147098, -0.7568025 ,  0.98935825,
         0.90929743],
       [-0.95892427,  0.90929743,  0.14112001,  0.14112001,  0.        ,
         0.        ]])
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

Successfully merging a pull request may close this issue.

1 participant