I sometimes need the rank of the inner tensors in a tensor of tensors (ToT). range().rank() only knows about the outer rank. AFAIK at the moment the only way to get the inner rank is to grab a tile and then call .range().rank() on a non-empty element of the tile. I'm not sure if it's possible for there to be zero local tiles, if so, then you'll have to grab a remote tile and ask for its rank.
I see two better solutions:
- The easiest: have DistArray keep track of inner tile ranks when they're being inserted
- The more correct (?), but harder: Have the Range object know about the range hierarchy
Reactions are currently unavailable
I sometimes need the rank of the inner tensors in a tensor of tensors (ToT). range().rank() only knows about the outer rank. AFAIK at the moment the only way to get the inner rank is to grab a tile and then call .range().rank() on a non-empty element of the tile. I'm not sure if it's possible for there to be zero local tiles, if so, then you'll have to grab a remote tile and ask for its rank.
I see two better solutions: