Updated on 2022-03-13 GMT+08:00

GetWorkspaceSizeFn

Function

Obtains the size of workspace.

Syntax

OpRegistrationData& GetWorkspaceSizeFn(GetWorkspaceSizeFunc getWorkspaceSizeFn);

Parameter Description

Parameter

Input/Output

Description

getWorkspaceSizeFn

Input

Callback function GetWorkspaceSizeFunc. For details, see Callback Function GetWorkspaceSizeFunc.

Callback Function GetWorkspaceSizeFunc

You can customize and implement GetWorkspaceSizeFunc class function to calculate the workspace size of an operator and export the calculation result.

Syntax

Status GetWorkspaceSizeFn(domi::Status (const ge::Operator& op, std::vector<int64_t>& size));

Parameter Description

Parameter

Input/Output

Description

op

Input

Operator object whose workspace needs to be calculated

For details about the operator class, see Operator Class APIs in GE API Reference.

size

Output

Size of the workspace. The value needs to be calculated and provided by the user.