1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] How to transpose 'ExprMulElement' object in mosek Fusion API

Discussão em 'Python' iniciado por Stack, Setembro 14, 2024.

  1. Stack

    Stack Membro Participativo

    I am trying to transpose an expression in fusion.

    According to fusion API's document I tried to transpose the Expression by Expr.transpose() method. However, It is not working for "ExprMulElement".

    import mosek.fusion as *

    # Create a model
    M = Model()

    # Example dimensions
    N, C = 4, 3

    # Define a variable (N x C matrix)
    X = M.variable([N, C])

    A = np.random.rand(N, C)

    Y = Expr.mulElm(A, X)

    # Transpose the matrix (C x N)
    Y_transpose = Y.transpose()



    The error is this. AttributeError: 'ExprMulElement' object has no attribute 'transpose' How can I transpose an "ExprMulElement" object?

    Continue reading...

Compartilhe esta Página