shape property

List<int> shape

Get shape of the list

Implementation

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;
}