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

El.Sqrt with El.EntrywiseMap for DistMatrix shows error #248

Open
haoyuanli93 opened this issue Nov 2, 2017 · 2 comments
Open

El.Sqrt with El.EntrywiseMap for DistMatrix shows error #248

haoyuanli93 opened this issue Nov 2, 2017 · 2 comments

Comments

@haoyuanli93
Copy link

I am writing a script using Elemental to do some kind of manifold embedding. In the script I need to apply El.Sqrt to every element in the matrix. But the code gives me errors.

The code goes like this.

norm = El.DistMatrix()
El.Zeros(norm, num, 1)
El.Hadamard(A=data, B=data, C = data)
El.Gemv(A=data, alphaPre=1, betaPre=0, x = length_ones, y = norm, orient = El.TRANSPOSE)
El.EntrywiseMap(A = norm, mapFunc = El.Sqrt)

While the error is:

Traceback (most recent call last):
File "_ctypes/callbacks.c", line 315, in 'calling callback function'
File "/usr/local/python/El/core/Element.py", line 245, in Sqrt
else: raise Exception('Unsupported datatype')
Exception: Unsupported datatype

Is this anybody have any idea about what's going on?

What I aim to do is quite simple. I have a matrix called data. Each row of the matrix is a vector. I want to get the L2 norm of the vector and thus normalize each of them.

@poulson
Copy link
Member

poulson commented Nov 3, 2017

This is rather strange. Modifying line 245 of /usr/local/python/El/core/Element.py to print the type of the datatype causing the fallthrough (before raising the exception) should be enlightening.

@haoyuanli93
Copy link
Author

Okay, I'll try that.

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