depth(toSpace2DTensor:widthAxis:heightAxis:depthAxis:blockSize:usePixelShuffleOrder:name:)
Creates a depth-to-space2D operation and returns the result tensor.
Declaration
func depth(toSpace2DTensor tensor: MPSGraphTensor, widthAxis: Int, heightAxis: Int, depthAxis: Int, blockSize: Int, usePixelShuffleOrder: Bool, name: String?) -> MPSGraphTensorParameters
- tensor:
The input tensor.
- widthAxis:
The axis that defines the fastest running dimension within the block.
- heightAxis:
The axis that defines the 2nd fastest running dimension within the block.
- depthAxis:
The axis that defines the destination dimension, where to copy the blocks.
- blockSize:
The size of the square spatial sub-block.
- usePixelShuffleOrder:
A parameter that controls the layout of the sub-blocks within the depth dimension.
- name:
The name for the operation.
Return Value
A valid MPSGraphTensor object.
Discussion
This operation outputs a copy of the input tensor, where values from the depthAxis dimension are moved in spatial blocks of size blockSize to the heightAxis and widthAxis dimensions. Use the usePixelShuffleOrder parameter to control how the data within spatial blocks is ordered in the depthAxis dimension: with usePixelShuffleOrder = YES MPSGraph stores the values of the spatial block contiguosly within the depthAxis dimension, whereas without it they are stored interleaved with existing values in the depthAxisTensor dimension. This operation is the inverse of space(toDepth2DTensor:widthAxis:heightAxis:depthAxis:blockSize:usePixelShuffleOrder:name:).