Skip to main content

ClikaRT::ops::split_by_size

function

split_by_size()

std::vector<Tensor> split_by_size(
    Tensor x,
    int64_t chunk_size,
    int64_t dim = 0
)

Split along dim into pieces of chunk_size, ceil(extent / chunk_size) of them, the last possibly shorter. Returns VIEWS sharing the source's storage (no copy).

Throws

  • ClikaRT::Error: (INVALID_ARGUMENT) when chunk_size is not positive (code_name() carries the reason).

Returns: the per-piece views.

Declared in ClikaRT/compute/ops.h, line 3387