Contents

constant(_:dataType:)

Creates a constant operation and returns the result tensor.

Declaration

func constant(_ scalar: Double, dataType: MPSDataType) -> MPSGraphTensor

Parameters

  • scalar:

    The scalar value to fill the entire tensor values with.

  • dataType:

    The dataType of the constant tensor.

Return Value

A valid MPSGraphTensor object.