How to write ragged tensor in Pytorch?

How to write ragged tensor in Pytorch?

You could check the nestedtensor prototype.