ClikaRT::ops::flatten
function
flatten()
Collapse the INCLUSIVE dim range [start_dim, end_dim] into one dim; the defaults collapse everything to 1-D.
Returns a view sharing storage when the input's stride layout factors into the merged shape (contiguous inputs always do); copies into a fresh dense tensor otherwise.
Throws
ClikaRT::Error: (INVALID_ARGUMENT) when the dim range is invalid (code_name()carries the reason).
Returns: the flattened tensor, a view when the layout permits.
auto tokens = ClikaRT::ops::flatten(x, 0, 1); // [B, S, D] -> [B*S, D]
Declared in ClikaRT/compute/ops.h, line 3186