Class SliceOption

Class Documentation

class SliceOption

SliceOption used in Slice TensorTransform.

Public Functions

inline explicit SliceOption(bool all)

Example
/* Slice all the data. */
SliceOption slice_option = SliceOption(True);

Parameters

all[in] Slice the whole dimension

inline explicit SliceOption(const std::vector<dsize_t> &indices)

Example
/* Slice the given dimensions. */
std::vector<int64_t> indices = {0, 3, 6, 7};
SliceOption slice_option = SliceOption(indices);

Parameters

indices[in] Slice these indices along the dimension. Negative indices are supported.

inline explicit SliceOption(const Slice &slice)

Example
/* Slice dimension from 2 to 10 with step 2. */
SliceOption slice_option = SliceOption(Slice(0, 10, 2));
transforms::Slice slice_op = transforms::Slice({slice_option});

Parameters

slice[in] Slice the generated indices from the slice object along the dimension.