Python Get Dimension Of Numpy Array To Tensor Product Of Modules