Skip to content
fn

distinct_dims

int distinct_dims(const int & dims, int ndim, const char * op)

Wrap each entry of dims through wrap_dim, keeping the order, and refuse a list that names one axis twice, as the reference does. An op that walks the list (flip) would otherwise act on that axis twice and undo itself.

Raises

IndexError
Some entry of dims is refused by wrap_dim.
LucidError
Two entries name the same axis.