Layout.internal constructor
- @internal
Internal constructor of Layout object.
Implementation
@internal
Layout.internal({
required this.rank,
required this.length,
required this.offset,
required this.shape,
required this.strides,
required this.isContiguous,
}) : assert(shape is TypedData, '`shape` should be TypedData'),
assert(shape.length == rank, '`shape` should be of length $rank'),
assert(shape.every((s) => s > 0), '`shape` should be positive'),
assert(strides is TypedData, '`strides` should be TypedData'),
assert(strides.length == rank, '`strides` should be of length $rank'),
assert(length == shape.product() || (length == 0 && rank == 0),
'`length` should match `shape`'),
assert(
isContiguous == utils.isContiguous(shape: shape, strides: strides));