Group Abstract Group Abstract

Message Boards Message Boards

0
|
2.5K Views
|
0 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Efficient ways to speed up Flatten or ArrayReshape-Transpose on tensors

Hello, I have been working with numerical tensors. I have some tensor A where Dimensions[A]={2,2,100,100,100,100}. I want to create a tensor of the form
Dimensions[A]={2*100*100,2*100*100}. This can be done for example as Flatten[A,{{1,3,4},{2,5,6}}] or as ArrayReshape[Transpose[A,...],{2*100*100,2*100*100}] .

First of all the second option is faster than the first. After comparing with matlabs equivalent I found out that mathematica is 5-10 times slower. I would appreciate any pro tricks to speed up that calculation.

POSTED BY: Alex Michailidis
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard