#matrix has shape (batch,times*features)
matrix<-matrix(data=c(1,1,1,2,2,2,
2,2,2,3,3,3,
1,1,1,1,1,1),
nrow=3,
byrow=TRUE)
matrix
#Transform matrix to a array
#array has shape (batch,times*features)
matrix_to_array_c(matrix=matrix,times=2,features=3)
Run the code above in your browser using DataLab