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

Assemble tensors from nested lists of blocks #569

Closed
hekaisheng opened this issue Jul 22, 2019 · 0 comments · Fixed by #2069
Closed

Assemble tensors from nested lists of blocks #569

hekaisheng opened this issue Jul 22, 2019 · 0 comments · Fixed by #2069
Labels

Comments

@hekaisheng
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Numpy supports assembling an ndarray from nested lists of blocks in version 1.13.0, we can add the same interface like mt.block to build a block matrix.

In [1]: import mars.tensor as mt                                                                                                                     

In [2]: a = mt.array([1, 2, 3])                                                                                                                      

In [3]: b = mt.array([2, 3, 4])                                                                                                                      

In [4]: c = mt.block([[a], [b]])                                                                                                                     

In [5]: c.execute() 
Out[5]: 
array([[1, 2, 3],
       [2, 3, 4]])

Describe the solution you'd like
The implementation may be similar with concatenate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants