isContiguous

WIP

version(grain_cuda)
bool
isContiguous
(
T
size_t dim
alias Storage
)
(
Variable!(T, dim, Storage) x
)

Examples

{
    auto x = [[0.1f, 0.2f], [0.3f, 0.4f]].variable;
    assert(x.isContiguous);
    x.strides = [2, 2];
    assert(!x.isContiguous);
}
version (grain_cuda) {
    auto x = [[0.1f, 0.2f], [0.3f, 0.4f]].variable.to!DeviceStorage;
    assert(x.isContiguous);
    x.strides = [2, 2];
    assert(!x.isContiguous);
}

Meta