Get shape of the list
List<int> get shape { if (isEmpty) { return []; } var list = this as dynamic; var shape = <int>[]; while (list is List) { shape.add(list.length); list = list.elementAt(0); } return shape; }