Python Get Dimension Of Numpy Array To Tensor Product Pdfs