Contents

bottomKGradient(_:source:axis:k:name:)

Creates a BottomKGradient operation and returns the result tensor.

Declaration

func bottomKGradient(_ gradient: MPSGraphTensor, source: MPSGraphTensor, axis: Int, k: Int, name: String?) -> MPSGraphTensor

Parameters

  • gradient:

    Tensor containing the incoming gradient.

  • source:

    Tensor containing source data.

  • axis:

    The dimension along which to compute the BottomK values.

  • k:

    The number of largest values to return.

  • name:

    The name for the operation.

Return Value

A valid MPSGraphTensor object.

Discussion

Finds the K smallest values along the minor dimension of the input. The input must have at least K elements along its minor dimension.