Thank you so much for the reply. I am now trying to re-implement a paper (http://openaccess.thecvf.com/content_ICCV_2017/papers/Zhang_View_Adaptive_Recurrent_ICCV_2017_paper.pdf 6). The paper tries to rotate a 3D point sequence and then use a LSTM to do the classification. To rotate the 3D sequence, it use two LSTM networks to predict the rotation and transition parameter respectively. Therefore the coordinate transformation is processed inside the network.
I have already get the transformation parameter for rotation (r_para) and transition(t_para). In each iteration, I have (batch_size) 3D sequence to rotate. Each 3D sequence has (time_step) frames. Each frame includes 25 points and each point is represented by (x,y,z). Each frame of each sequence sample has its own transformation parameters. The two for loop part is trying to apply the rotation and transition operation on the input samples, looping on each frame of each 3D sequence sample in the batch.
So x inside the code is the input sample. Its size is (batch_size, time_step, 25 * 3). The size of the two parameters, t_para and r_para, are (batch_size, time_step, 3).
I am not sure whether I have made my problem clear. Thanks again for the help.