Array constructor

Array({
  1. required List<List<double>> values,
  2. Tuple2<int, int>? shape,
})

Implementation

Array({required this.values, Tuple2<int, int>? shape}) {
  shape ??=
      Tuple2(values.length, values.isNotEmpty ? values.first.length : 0);

  // assert the values list has the correct shape
  assert(values.every((line) => line.length == shape!.item2));

  this.shape = shape;
}