Function: model_subscribe

Applicable Products

Product

Supported (√/x)

Ascend 950PR / Ascend 950DT

Atlas A3 training products / Atlas A3 inference products

Atlas A2 training products / Atlas A2 inference products

Atlas training products

Atlas inference products

Atlas 200I/500 A2 inference products

Description

Subscribes to basic operator information, including the operator name, operator type, and operator execution time.

Prototype

  • C Prototype
    1
    aclError aclprofModelSubscribe(uint32_t modelId, const aclprofSubscribeConfig *profSubscribeConfig)
    
  • Python Function
    1
    ret = acl.prof.model_subscribe(model_id, subscribe_config)
    

Parameters

Parameter

Description

model_id

Int, ID of the model to be subscribed to. After the acl.mdl.load_from_file, acl.mdl.load_from_mem, acl.mdl.load_from_file_with_mem, or acl.mdl.load_from_mem_with_mem API is called to load a model, the model ID is returned.

subscribe_config

Int, configuration to be subscribed to. Call acl.prof.create_subscribe_config to create configuration data.

Return Values

Return Value

Description

ret

Int, error code.

Restrictions

This API must be used in pair with acl.prof.model_unsubscribe.