OperatorCalculationDelegate
public protocol OperatorCalculationDelegate
The delegate support methods tracking the calculation status and result of associated Operator
object.
Operator could assign attribute computationDelegate
to a instance conforms to this protocol.
The instanced could track the calculation status of operator.
-
Tell the delegate this
Operator
will begin to calcualte the output tensor- op: The calculation operator
Declaration
Swift
func operatorWillBeginComputation(_ op: ComputableOperator)
-
Tell the delegate this
Operator
has done the calcualtion.- op: The calcaulation operator.
- tensor: The calcualted output tensors object.
Declaration
Swift
func operatorDidEndComputation(_ op: ComputableOperator, outputTensors tensors: [Tensor])
-
Tell the delegate this operator will begin grads calculation
Declaration
Swift
func operatorWillBeginGradsComputation(_ op: ComputableOperator)
Parameters
op
op
-
Tell the delegate this operator end grads claculation
Declaration
Swift
func operatorDidEndGradsComputation(_ op: ComputableOperator, grads: [String: DataSymbolSupportedDataType])
Parameters
op
op
tensors
grads tensor