Solved by albanD in post #3 
              
              
                Hi, 
Some precisions to Alexey’s message: 


Indeed, the problem is not with only expand, but with expand + the inplace. And in particular because expand is a view of a.  This is why you don’t see any issue if you remove the inplace or if you replace the expand with a repeat that is not a view (it a…