Class SliceOption

Class Documentation

class SliceOption

SliceOption used in Slice TensorTransform.

Public Functions

inline explicit SliceOption(bool all)

Parameters

all[in] Slice the whole dimension

样例
/* Slice all the data. */
SliceOption slice_option = SliceOption(True);
inline explicit SliceOption(const std::vector<dsize_t> &indices)

Parameters

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

样例
/* Slice the given dimensions. */
std::vector<int64_t> indices = {0, 3, 6, 7};
SliceOption slice_option = SliceOption(indices);
inline explicit SliceOption(const Slice &slice)

Parameters

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

样例
/* 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});