Thanks for mentioning tsalib - I’m the tool’s author.
Unfortunately, there is hardly any convention right now for shape annotation - in tsalib, we’ve introduced a shorthand string notation for naming shapes (and their arithmetic derivatives) and  piggybacked on to Python’s type annotations feature to make tensor shapes explicit.  This allows shape specs to be inline with code and IMO, this is far better than adhoc comments.
The annotations can be extended to include dtypes too but we haven’t added that yet. Something like ‘b,t,d;f32’. Do you think that will be helpful?
Would love to learn more how other developers work with named shapes and how tsalib can help them.