Contents

resizeNearest(withGradientTensor:input:scaleOffsetTensor:nearestRoundingMode:layout:name:)

Creates a Resize gradient operation and returns the result tensor.

Declaration

func resizeNearest(withGradientTensor gradient: MPSGraphTensor, input: MPSGraphTensor, scaleOffsetTensor scaleOffset: MPSGraphTensor, nearestRoundingMode: MPSGraphResizeNearestRoundingMode, layout: MPSGraphTensorNamedDataLayout, name: String?) -> MPSGraphTensor

Parameters

  • gradient:

    Incoming gradient tensor

  • input:

    Forward pass input tensor

  • scaleOffset:

    1D float tensor. A 4-element shape as [scaleY, scaleX, offsetY, offsetX]

  • nearestRoundingMode:

    The rounding mode to use when using nearest resampling.

  • layout:

    Specifies what layout the provided tensor is in. The returned tensor will follow the same layout. Valid layouts are NHWC, NCHW, HWC, CHW, and HW.

  • name:

    The name for the operation.

Return Value

A valid MPSGraphTensor object

Discussion

Computes the gradient for the forward pass Resize op with identical parameters. See discussion of resizeTensor for more in depth description of resize paramters.