Skip to content

Enh: Request for the tensor Contraction with high order sparse tensor #897

@Ycq1111

Description

@Ycq1111

Please describe the purpose of the new feature or describe the problem to solve.

In the numerical simulation, especailly the reduce order model, we need to deal with a high order sparse tensor. For example, we consider a 4th-order sparse tensor A with shape (100, 100, 200, 200). We multiply A along its 4th axis(l) with a vector B of shape (200,) to obtain a 3rd-order tensor C of shape (100, 100, 200). We do not have appropriate tool to deal with such a high order sparse tensor.

Suggest a solution if possible.

For tensor A, we have coords = [i,j,k,l] and values. we can get C with sparse.COO(newcoords = [i,j,k], newvalues = values*B[l], shape=(A.shape[0], A.shape[1], A.shape[2] ).

If you have tried alternatives, please describe them below.

No response

Additional information that may help us understand your needs.

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementIndicates new feature requestsneeds triageIssue has not been confirmed nor labeled

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions