The operator create_dl_layer_slicecreate_dl_layer_sliceCreateDlLayerSliceCreateDlLayerSlicecreate_dl_layer_slice creates a slice layer that extracts
a single slice of a tensor along specified axes, based on the provided start
and end indices as well as the step size for the slicing operations.
The handle of the slice layer is returned in DLLayerSliceDLLayerSliceDLLayerSliceDLLayerSlicedllayer_slice.
Determines the step size for the slicing
operation along the axes specified in 'axes'"axes""axes""axes""axes".
The parameter 'steps'"steps""steps""steps""steps" must either be an empty
tuple or have the same length as 'axes'"axes""axes""axes""axes". If it is empty, the
'steps'"steps""steps""steps""steps" are set to 1 for all 'axes'"axes""axes""axes""axes".
This parameter is set using StepsStepsStepsstepssteps.
'axes'"axes""axes""axes""axes"
Specifies the axes along which the slicing
operation is performed. The axes are defined in the format WHC,
representing Width, Height, and Channel and can also be
specified as strings. Slicing in the Batch dimension is not supported.
This parameter is set using AxesAxesAxesaxesaxes.
The slice layer allows slicing a tensor along specified axes, providing
flexible adjustment options.
To ensure correct operations 'starts'"starts""starts""starts""starts" and 'ends'"ends""ends""ends""ends" must have
the same length as the parameter 'axes'"axes""axes""axes""axes".
Negative values in 'starts'"starts""starts""starts""starts" and 'ends'"ends""ends""ends""ends" are adjusted by
adding the size of the corresponding array dimension, effectively allowing
negative indexing for one iteration. After that, negative values are clamped
to prevent further out-of-bounds slicing.
Negative values in 'axes'"axes""axes""axes""axes" are adjusted by adding the total number of
dimensions of the tensor to the respective axis.
Negative value means counting dimensions from the back.
The accepted range is [, ] where = rank.
For slicing to the end of a dimension with unknown size, it is recommended
to pass in H_INT_MAX when slicing forward and H_INT_MIN when slicing backward.
Handling of axes and indices
Adjusting axes
Negative values in the 'axes'"axes""axes""axes""axes" parameter are made non-negative by
adding the rank of the input tensor to each negative axis:
Adjusting 'starts' and 'ends'
Negative Index Adjustment
Negative values in 'starts'"starts""starts""starts""starts" and 'ends'"ends""ends""ends""ends" are adjusted
by adding the respective tensor dimension size:
'starts'"starts""starts""starts""starts"[] is adjusted by adding the tensor dimension size.
'ends'"ends""ends""ends""ends"[] is adjusted by adding the respective tensor dimension size.
Clamping 'starts' Values
Adjusted 'starts'"starts""starts""starts""starts" values are clamped to the range:
Clamping 'ends' Values
Adjusted 'ends'"ends""ends""ends""ends" values are clamped based on the step direction:
Positive Stepping:
'ends'"ends""ends""ends""ends" is clamped to the range [0, dims].
Negative Stepping:
'ends'"ends""ends""ends""ends" is clamped to the range [-1, dims - 1].
Determines whether apply_dl_modelapply_dl_modelApplyDlModelApplyDlModelapply_dl_model will include the output of this
layer in the dictionary DLResultBatchDLResultBatchDLResultBatchDLResultBatchdlresult_batch even without specifying this
layer in OutputsOutputsOutputsoutputsoutputs ('true'"true""true""true""true") or not ('false'"false""false""false""false").
List of values:
'true'"true""true""true""true", 'false'"false""false""false""false"