Contents

squeeze(_:axesTensor:name:)

Creates a squeeze operation and returns the result tensor.

Declaration

func squeeze(_ tensor: MPSGraphTensor, axesTensor: MPSGraphTensor, name: String?) -> MPSGraphTensor

Parameters

  • tensor:

    The input tensor.

  • axesTensor:

    The tensor containing the axes to squeeze.

  • name:

    The name for the operation.

Return Value

A valid MPSGraphTensor object

Discussion

Squeezes the tensor, removing dimensions with size 1 at specified axes. The size of the input tensor must be 1 at all specified axes.