create_dl_layer_gather T_create_dl_layer_gather CreateDlLayerGather CreateDlLayerGather create_dl_layer_gather (Operator)
Name
create_dl_layer_gather T_create_dl_layer_gather CreateDlLayerGather CreateDlLayerGather create_dl_layer_gather — Create a gather layer.
Signature
void CreateDlLayerGather (const HTuple& DLLayerInput , const HTuple& Indices , const HTuple& LayerName , const HTuple& Axis , const HTuple& GenParamName , const HTuple& GenParamValue , HTuple* DLLayerGather )
HDlLayer HDlLayer ::CreateDlLayerGather (const HTuple& Indices , const HString& LayerName , const HTuple& Axis , const HTuple& GenParamName , const HTuple& GenParamValue ) const
HDlLayer HDlLayer ::CreateDlLayerGather (Hlong Indices , const HString& LayerName , Hlong Axis , const HString& GenParamName , const HString& GenParamValue ) const
HDlLayer HDlLayer ::CreateDlLayerGather (Hlong Indices , const char* LayerName , Hlong Axis , const char* GenParamName , const char* GenParamValue ) const
HDlLayer HDlLayer ::CreateDlLayerGather (Hlong Indices , const wchar_t* LayerName , Hlong Axis , const wchar_t* GenParamName , const wchar_t* GenParamValue ) const
(
Windows only)
static void HOperatorSet .CreateDlLayerGather (HTuple DLLayerInput , HTuple indices , HTuple layerName , HTuple axis , HTuple genParamName , HTuple genParamValue , out HTuple DLLayerGather )
HDlLayer HDlLayer .CreateDlLayerGather (HTuple indices , string layerName , HTuple axis , HTuple genParamName , HTuple genParamValue )
HDlLayer HDlLayer .CreateDlLayerGather (int indices , string layerName , int axis , string genParamName , string genParamValue )
Description
The operator create_dl_layer_gather create_dl_layer_gather CreateDlLayerGather CreateDlLayerGather create_dl_layer_gather creates a gather layer that
extracts slices from the input tensor DLLayerInput DLLayerInput DLLayerInput DLLayerInput dllayer_input along a
specified axis, according to the indices provided.
The handle of the gather layer is returned in DLLayerGather DLLayerGather DLLayerGather DLLayerGather dllayer_gather .
The parameter DLLayerInput DLLayerInput DLLayerInput DLLayerInput dllayer_input determines the feeding input layer and
expects the layer handle as its value.
The parameter Indices Indices Indices indices indices defines the indices to be gathered from the
axis. The indices must be either of rank 0 or rank 1, i.e., a scalar or a
list. The indices input can be a layer handle (Indices Indices Indices indices indices ) or a tuple
of integers.
If Indices Indices Indices indices indices is given as a tuple of integers, internally a constant
input layer is created.
The axis along which the gathering is performed is specified by the parameter
Axis Axis Axis axis axis . Axis Axis Axis axis axis can either be specified by a string
('width' "width" "width" "width" "width" , 'height' "height" "height" "height" "height" , 'depth' "depth" "depth" "depth" "depth" or 'batch' "batch" "batch" "batch" "batch" ) or an
integer, where 0 corresponds to the batch size, 1 to depth, 2 to height and 3
to width. Negative values for Axis Axis Axis axis axis indicate counting dimensions from
the back. The accepted range is [-4,3].
The parameter LayerName LayerName LayerName layerName layer_name sets an individual layer name.
Note that if creating a model using create_dl_model create_dl_model CreateDlModel CreateDlModel create_dl_model , each layer
of the created network must have a unique name.
Gather semantics
Given a 4-dimensional input tensor DLLayerInput DLLayerInput DLLayerInput DLLayerInput dllayer_input of shape
(N, C, H, W) and an indices tensor or tuple,
the gather layer selects elements from the Axis Axis Axis axis axis dimension indexed
by elements of Indices Indices Indices indices indices .
If the indices are given as a tuple
and
Axis Axis Axis axis axis
, the output tensor is constructed by replacing dimension
with the indices dimensions, resulting in an output of shape
All index values in Indices Indices Indices indices indices must be within the bounds
, where
is the size of the Axis Axis Axis axis axis
dimension. Negative indices are interpreted by adding
, i.e.,
'index' "index" "index" "index" "index" = 'index' "index" "index" "index" "index"
if 'index' "index" "index" "index" "index" < 0.
Index Processing
Adjusting Axis
Negative values for Axis Axis Axis axis axis are made non-negative by adding the
number of dimensions r of the input tensor:
Clamping Indices
Negative values in Indices Indices Indices indices indices are adjusted by adding the size s
of the corresponding axis:
All values in Indices Indices Indices indices indices must satisfy
Otherwise, an error will be raised.
The following generic parameters GenParamName GenParamName GenParamName genParamName gen_param_name and the corresponding
values GenParamValue GenParamValue GenParamValue genParamValue gen_param_value are supported:
'is_inference_output' "is_inference_output" "is_inference_output" "is_inference_output" "is_inference_output" :
Determines whether apply_dl_model apply_dl_model ApplyDlModel ApplyDlModel apply_dl_model will include the output of this
layer in the dictionary DLResultBatch DLResultBatch DLResultBatch DLResultBatch dlresult_batch even without specifying
this layer in Outputs Outputs Outputs outputs outputs ('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"
Default:
'false' "false" "false" "false" "false"
Certain parameters of layers created using this operator
create_dl_layer_gather create_dl_layer_gather CreateDlLayerGather CreateDlLayerGather create_dl_layer_gather can be set and retrieved using further operators.
The following tables give an overview, which parameters can be set
using set_dl_model_layer_param set_dl_model_layer_param SetDlModelLayerParam SetDlModelLayerParam set_dl_model_layer_param and which ones can be retrieved using
get_dl_model_layer_param get_dl_model_layer_param GetDlModelLayerParam GetDlModelLayerParam get_dl_model_layer_param or get_dl_layer_param get_dl_layer_param GetDlLayerParam GetDlLayerParam get_dl_layer_param .
Note, the operators set_dl_model_layer_param set_dl_model_layer_param SetDlModelLayerParam SetDlModelLayerParam set_dl_model_layer_param and
get_dl_model_layer_param get_dl_model_layer_param GetDlModelLayerParam GetDlModelLayerParam get_dl_model_layer_param require a model created by create_dl_model create_dl_model CreateDlModel CreateDlModel create_dl_model .
Generic Layer Parameters
set
get
'is_inference_output' "is_inference_output" "is_inference_output" "is_inference_output" "is_inference_output"
x
x
'num_trainable_params' "num_trainable_params" "num_trainable_params" "num_trainable_params" "num_trainable_params"
x
Execution Information
Multithreading type: reentrant (runs in parallel with non-exclusive operators).
Multithreading scope: global (may be called from any thread).
Processed without parallelization.
Parameters
DLLayerInput DLLayerInput DLLayerInput DLLayerInput dllayer_input (input_control) dl_layer → HDlLayer , HTuple HHandle HTuple Htuple (handle) (IntPtr ) (HHandle ) (handle )
Feeding data input layer.
Default:
'DLLayerInput'
"DLLayerInput"
"DLLayerInput"
"DLLayerInput"
"DLLayerInput"
Indices Indices Indices indices indices (input_control) number(-array) → HTuple MaybeSequence[Union[int, HHandle]] HTuple Htuple (integer / handle) (int / long / HHandle) (Hlong / HHandle) (Hlong / handle)
Indices for the gather operation. This input can be a layer or
tuple of integers.
LayerName LayerName LayerName layerName layer_name (input_control) string → HTuple str HTuple Htuple (string) (string ) (HString ) (char* )
Name of the output layer.
Axis Axis Axis axis axis (input_control) number → HTuple Union[int, str] HTuple Htuple (integer / string) (int / long / string) (Hlong / HString) (Hlong / char*)
Axis along which to gather.
Default:
0
Suggested values:
0, 'batch' "batch" "batch" "batch" "batch" , 1, 'depth' "depth" "depth" "depth" "depth" , 2, 'height' "height" "height" "height" "height" , 3, 'width' "width" "width" "width" "width"
GenParamName GenParamName GenParamName genParamName gen_param_name (input_control) attribute.name(-array) → HTuple MaybeSequence[str] HTuple Htuple (string) (string ) (HString ) (char* )
Generic input parameter names.
Default:
[]
List of values:
'is_inference_output' "is_inference_output" "is_inference_output" "is_inference_output" "is_inference_output"
GenParamValue GenParamValue GenParamValue genParamValue gen_param_value (input_control) attribute.value(-array) → HTuple MaybeSequence[Union[int, float, str]] HTuple Htuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double)
Generic input parameter values.
Default:
[]
Suggested values:
'true' "true" "true" "true" "true" , 'false' "false" "false" "false" "false"
DLLayerGather DLLayerGather DLLayerGather DLLayerGather dllayer_gather (output_control) dl_layer → HDlLayer , HTuple HHandle HTuple Htuple (handle) (IntPtr ) (HHandle ) (handle )
Output layer.
Module
Deep Learning Professional