ParseParamsFn

Description

Registers a function for parsing operator attributes.

Prototype

OpRegistrationData &ParseParamsFn(const ParseParamFunc &parseParamFn)

Parameters

Parameter

Input/Output

Description

parseParamFn

Input

ParseParamFunc for parsing operator attributes. For details, see Callback Function ParseParamFunc.

For TensorFlow, if a TensorFlow operator and its equivalent supported by the Ascend AI Processor have consistent attributes in terms of both the attribute count and attribute sequence, the AutoMappingFn function can be called to implement automatic mapping.

Restrictions

For custom operator plugins, ParseParamsFn will be deprecated in later versions. Use the ParseParamsByOperatorFn API instead.

If you have developed an operator plugin by using the ParseParamsFn API, perform the following operations to adapt to the new API:

  1. Call the ParseParamsByOperatorFn API to develop the operator plugin again.
  2. Rebuild the custom operator project with the build script of the new sample project.

Callback Function ParseParamFunc

Call the user-defined FusionParseParamFunc function to map operator attributes of the original model to those of the model adapted to Ascend AI Processor and fill the result in class Operator.

using ParseParamFunc = std::function<domi::Status(const google::protobuf::Message *, ge::Operator &)>

  • The first argument is an input, which is the data structure in Protobuf format (from the .prototxt file of the original model) and contains the operator attribute information.
  • The second parameter is an output, which is the operator data structure of the model adapted to Ascend AI Processor and stores the operator information. For details about class Operator, see Operator.