Layout constructor
Implementation
factory Layout({Iterable<int>? shape, Iterable<int>? strides, int? offset}) {
final shape_ = utils.toIndices(shape ?? const <int>[]);
final strides_ = strides == null
? utils.toStrides(shape: shape_)
: utils.toIndices(strides);
return Layout.internal(
rank: shape_.length,
length: shape_.product(),
shape: shape_,
strides: strides_,
offset: offset ?? 0,
isContiguous: shape_.isEmpty ||
strides == null ||
utils.isContiguous(shape: shape_, strides: strides_),
);
}