One Logo Pool Ball
Accelerate · IOS API REFERENCE

BNNS.CropResizeLayer

class · iOS 16.0+ · SDK 27.1

class CropResizeLayer

Members (3)

method · iOS 16.0+

applyBackward

TypeScript
applyBackward(regionOfInterest: BNNSNDArrayDescriptor, outputGradient: BNNSNDArrayDescriptor, inputGradient: BNNSNDArrayDescriptor, filterParameters?: (BNNSFilterParameters) | null): void
Swift declaration
func applyBackward(regionOfInterest: BNNSNDArrayDescriptor, outputGradient: BNNSNDArrayDescriptor, generatingInputGradient inputGradient: BNNSNDArrayDescriptor, filterParameters: BNNSFilterParameters? = nil) throws

Applies crop resize layer to generate input gradient. - Parameter regionOfInterest: The region of interest. - Parameter outputGradient: The output gradient descriptor. - Parameter inputGradient: The input gradient descriptor. - Parameter filterParameters: Runtime filter parameters. - seealso: `BNNSCropResizeBackward`.

init · iOS 16.0+

init

TypeScript
static init(coordinatesAreNormalized: boolean, spatialScale: number, extrapolationValue: number, samplingMode: BNNS_CropResizeLayer_LinearSamplingMode, boxCoordinateMode: BNNS_CropResizeLayer_BoxCoordinateMode): BNNS_CropResizeLayer
Swift declaration
init(coordinatesAreNormalized: Bool, spatialScale: Float, extrapolationValue: Float = 0, samplingMode: BNNS.CropResizeLayer.LinearSamplingMode = .default, boxCoordinateMode: BNNS.CropResizeLayer.BoxCoordinateMode)

Returns a new crop resize layer. - Parameter coordinatesAreNormalized: A Boolean value that specifies whether the bounding box coordinates are normalized to (0, 1) - Parameter spatialScale: An additional spatial scale that multiplies the bounding box coordinates. - Parameter extrapolationValue: A value that the layer uses for extrapolation, when applicable. Default to zero. - Parameter samplingMode: The sampling mode that the layer uses to select sample points. - Parameter boxCoordinateMode: A structure that specifies the convention for specifying the four bounding box coordinates. - seealso: `BNNSLayerParametersCropResize` This initializer creates a layer that uses bilinear interpolation. This `samplingMode` parameter controls how the grid is sampled. If the input grid is `[0, Xin-1]` (corresponding to an input size of `Xin`), and if the output size is `Xout`, the layer samples grid points are sampled in the following manner: * `.default`: * spacing = `(Xin - Xin/Xout) / (Xout - 1)`, * `grid_point[i] = min(Xin-1, max(0, i*spacing)), for i=0,1,...,Xout-1` * `alignCorners`: The same as `.strictAlignCorners` unless `unless Xout=1` in which case: * `grid_point[0] = (Xin-1) / 2, if Xout==1` * `unalignCorners`: * `spacing = Xin / Xout` * `grid_point[i] = min(Xin - 1, max(0, i*spacing + 0.5*spacing - 0.5)), for i=0,1,...,Xout-1` * `strictAlignCorners`: * `spacing = (Xin - 1) / (Xout - 1)` * `grid_point[i] = min(Xin-1, max(0, i*spacing)), for i=0,1,...,Xout-1` * `offsetCorners`: * `delta = max(1, Xin - 1) / Xout` * `spacing = ((Xout - 1) * delta) / (Xout - 1)` * `grid_point[i] = min(Xin-1, max(0, 0.5*delta + i*spacing)), for i=0,1,...,Xout-1`

method · iOS 16.0+

apply

TypeScript
apply(input: BNNSNDArrayDescriptor, regionOfInterest: BNNSNDArrayDescriptor, output: BNNSNDArrayDescriptor, filterParameters?: (BNNSFilterParameters) | null): void
Swift declaration
func apply(input: BNNSNDArrayDescriptor, regionOfInterest: BNNSNDArrayDescriptor, output: BNNSNDArrayDescriptor, filterParameters: BNNSFilterParameters? = nil) throws

Applies crop resize layer. - Parameter input: The input descriptor. - Parameter regionOfInterest: The region of interest. - Parameter output: The output descriptor. - Parameter filterParameters: Runtime filter parameters. - seealso: `BNNSCropResize`.

Skipped declarations

No declarations were skipped in this snapshot.

All Accelerate types →