Skip to content

create_dl_layer_depth_to_spaceCreateDlLayerDepthToSpaceCreateDlLayerDepthToSpacecreate_dl_layer_depth_to_spaceT_create_dl_layer_depth_to_space🔗

Short description🔗

create_dl_layer_depth_to_spaceCreateDlLayerDepthToSpaceCreateDlLayerDepthToSpacecreate_dl_layer_depth_to_spaceT_create_dl_layer_depth_to_space — Create a depth to space layer.

Signature🔗

create_dl_layer_depth_to_space( dl_layer DLLayerInput, string LayerName, number BlockSize, string Mode, attribute.name GenParamName, attribute.value GenParamValue, out dl_layer DLLayerDepthToSpace )void CreateDlLayerDepthToSpace( const HTuple& DLLayerInput, const HTuple& LayerName, const HTuple& BlockSize, const HTuple& Mode, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* DLLayerDepthToSpace )static void HOperatorSet.CreateDlLayerDepthToSpace( HTuple DLLayerInput, HTuple layerName, HTuple blockSize, HTuple mode, HTuple genParamName, HTuple genParamValue, out HTuple DLLayerDepthToSpace )def create_dl_layer_depth_to_space( dllayer_input: HHandle, layer_name: str, block_size: int, mode: str, gen_param_name: MaybeSequence[str], gen_param_value: MaybeSequence[Union[int, float, str]] ) -> HHandle

Herror T_create_dl_layer_depth_to_space( const Htuple DLLayerInput, const Htuple LayerName, const Htuple BlockSize, const Htuple Mode, const Htuple GenParamName, const Htuple GenParamValue, Htuple* DLLayerDepthToSpace )

HDlLayer HDlLayer::CreateDlLayerDepthToSpace( const HString& LayerName, Hlong BlockSize, const HString& Mode, const HTuple& GenParamName, const HTuple& GenParamValue ) const

HDlLayer HDlLayer::CreateDlLayerDepthToSpace( const HString& LayerName, Hlong BlockSize, const HString& Mode, const HString& GenParamName, const HString& GenParamValue ) const

HDlLayer HDlLayer::CreateDlLayerDepthToSpace( const char* LayerName, Hlong BlockSize, const char* Mode, const char* GenParamName, const char* GenParamValue ) const

HDlLayer HDlLayer::CreateDlLayerDepthToSpace( const wchar_t* LayerName, Hlong BlockSize, const wchar_t* Mode, const wchar_t* GenParamName, const wchar_t* GenParamValue ) const (Windows only)

HDlLayer HDlLayer.CreateDlLayerDepthToSpace( string layerName, int blockSize, string mode, HTuple genParamName, HTuple genParamValue )

HDlLayer HDlLayer.CreateDlLayerDepthToSpace( string layerName, int blockSize, string mode, string genParamName, string genParamValue )

Description🔗

The operator create_dl_layer_depth_to_spaceCreateDlLayerDepthToSpace creates a depth to space layer whose handle is returned in DLLayerDepthToSpaceDLLayerDepthToSpacedllayer_depth_to_space.

The parameter DLLayerInputDLLayerInputdllayer_input determines the feeding input layer and expects the layer handle as value.

The parameter LayerNamelayerNamelayer_name sets an individual layer name. Note that if creating a model using create_dl_modelCreateDlModel each layer of the created network must have a unique name.

This layer rearranges the elements of the feeding tensor of shape \((N,C*r^2,H,W)\) to a tensor of shape \((N,C,H*r,W*r)\). Thereby \(r\) can be considered an upscale factor, which is set with BlockSizeblockSizeblock_size.

The output element \((depth, row, col)\) is mapped from the input element \((depth*r^2 + (row\%r)*r + col\%r, row/r, col/r)\).

With Modemodemode the ordering in the output tensor is set. Currently only the 'column_row_depth'"column_row_depth" order described above is available.

Certain parameters of layers created using this operator create_dl_layer_depth_to_spaceCreateDlLayerDepthToSpace can be set and retrieved using further operators. The following tables give an overview, which parameters can be set using set_dl_model_layer_paramSetDlModelLayerParam and which ones can be retrieved using get_dl_model_layer_paramGetDlModelLayerParam or get_dl_layer_paramGetDlLayerParam. Note, the operators set_dl_model_layer_paramSetDlModelLayerParam and get_dl_model_layer_paramGetDlModelLayerParam require a model created by create_dl_modelCreateDlModel.

Layer Parameters set get
'input_layer'"input_layer" (DLLayerInputDLLayerInputdllayer_input) x
'name'"name" (LayerNamelayerNamelayer_name) x x
'block_size'"block_size" (BlockSizeblockSizeblock_size) x
'shape'"shape" x
'type'"type" x
Generic Layer Parameters set get
'is_inference_output'"is_inference_output" x x
'num_trainable_params'"num_trainable_params" x

Execution information🔗

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🔗

DLLayerInputDLLayerInputdllayer_input (input_control) dl_layer → (handle)HTuple (HHandle)HDlLayer, HTuple (IntPtr)HHandleHtuple (handle)

Feeding layer.

LayerNamelayerNamelayer_name (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

Name of the output layer.

BlockSizeblockSizeblock_size (input_control) number → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Block size (i.e., upscale factor).

Default: 33

Modemodemode (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

Ordering mode.

Default: 'column_row_depth'"column_row_depth"

GenParamNamegenParamNamegen_param_name (input_control) attribute.name(-array) → (string)HTuple (HString)HTuple (string)MaybeSequence[str]Htuple (char*)

Generic input parameter names.

Default: [][]
List of values: 'is_inference_output'"is_inference_output"

GenParamValuegenParamValuegen_param_value (input_control) attribute.value(-array) → (string / integer / real)HTuple (HString / Hlong / double)HTuple (string / int / long / double)MaybeSequence[Union[int, float, str]]Htuple (char* / Hlong / double)

Generic input parameter values.

Default: [][]
Suggested values: 'true', 'false'"true", "false"

DLLayerDepthToSpaceDLLayerDepthToSpacedllayer_depth_to_space (output_control) dl_layer → (handle)HTuple (HHandle)HDlLayer, HTuple (IntPtr)HHandleHtuple (handle)

Depth to space layer.

Example🔗

(HDevelop)

InputShape := [16, 16, 3]
Upscale := 2
*
create_dl_layer_input ('input', InputShape, [], [], DLLayerInput)
* Create a convolutional layer, that generates Upscale^2*NumChannel feature maps.
create_dl_layer_convolution (DLLayerInput, 'conv1', 3, 1, 1,\
                             Upscale * Upscale * InputShape[2],\
                             1, 'half_kernel_size', 'none',\
                             [],  [], DLLayerConvolution)
* Use a depth to space layer to combine Upscale^2 feature maps to upscale.
create_dl_layer_depth_to_space (DLLayerConvolution, 'upscaled', Upscale,\
                                'column_row_depth',[], [],\
                                DLLayerDepthToSpace)
* The output shape of DLLayerDepthToSpace is now [16*Upscale, 16*Upscale, 3].
create_dl_model (DLLayerDepthToSpace, DLModel)

Combinations with other operators🔗

Combinations

Possible predecessors

create_dl_layer_inputCreateDlLayerInput, create_dl_layer_concatCreateDlLayerConcat, create_dl_layer_reshapeCreateDlLayerReshape

Possible successors

create_dl_layer_convolutionCreateDlLayerConvolution, create_dl_layer_denseCreateDlLayerDense, create_dl_layer_reshapeCreateDlLayerReshape

See also

create_dl_layer_reshapeCreateDlLayerReshape

Module🔗

Deep Learning Professional