CloneOperationParam

Description

Copies the Param of Operation to the second input parameter.

Definition

1
Status CloneOperationParam(const Operation *operation, OpParam &opParam);

Parameters

Parameter

Description

operation

Operation pointer

opParam

Reference to opParam, which is a shallow copy of the returned opParam.

Returns

Type

Input/Output

Description

Status

Output

Status value. NO_ERROR is returned on success.

Constraints

Supports parameters in atb/train_op_params.h and EventOperation.

Example

  1. Create an Operation.
    1
    2
    3
    4
    5
    train::FastSoftMaxParam param;
    param.headNum = 3;
    param.qSeqLen = { 10, 20, 30 };
    atb::Operation *op = nullptr;
    atb::Status st = atb::CreateOperation(param, &op);
    
  2. Obtain the parameters of the current Operation.
    1
    2
    train::FastSoftMaxParam cloneParam;
    st = atb::CloneOperationParam(op, cloneParam);