Contents

while(initialInputs:before:after:name:)

Adds a while loop operation.

Declaration

func `while`(initialInputs: [MPSGraphTensor], before: @escaping  MPSGraphWhileBeforeBlock, after: @escaping  MPSGraphWhileAfterBlock, name: String?) -> [MPSGraphTensor]

Parameters

  • initialInputs:

    inputTensors to the beforeBlock, for the 1st iteration will be same as initialInputs passed to the while loop.

  • before:

    beforeBlock, this will be run first and then call the afterBlock with results or return results from the loop.

  • after:

    afterBlock, this will execute after the condition evaluation.

  • name:

    Name of operation.

Return Value

A valid MPSGraphTensor array with results returned from the conditionBlock depending on the predicate tensor.