Description
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.