Skip to content

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

Open
@haoyuanli93

Description

@haoyuanli93

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions