Importing an Operator Project

This section describes how to import a sample project. The Ascend-CANN-Toolkit provides a complete set of operator implementation code samples, and allows you to deploy and verify operators and perform operator network verification without modifying the code.

  1. After the Ascend-CANN-Toolkit configuration is complete, perform the following operations in Linux scenarios:
    cp -r Ascend-CANN-Toolkit installation directory/ascend-toolkit/latest/tools/msopgen/template/operator_demo_projects $HOME/MindstudioProjects
    chmod -R 750 $HOME/MindstudioProjects/operator_demo_projects

    $HOME/MindstudioProjects is the user-defined directory for storing projects.

  2. Navigate to the dialog box for project importing.
    • On the MindStudio IDE welcome page, click Open in the Welcome to MindStudio window.
    • On the MindStudio IDE project page, click in the upper left corner of the project page. On the top menu bar, choose File > Open....
  3. In the Open File or Project window, select the folder of the sample project.

    Path of the sample project in Linux scenarios: $HOME/MindstudioProjects/operator_demo_projects

  4. Click OK to import the sample project.
    If a project has code risks, the trust window is displayed when you open the project.
    • If the project source code is trusted and secure, click Trust Project. (You can select Trust projects in <workspace_directory> to trust all projects in the directory.)
    • If the project is not trusted and you only want to view the source code, click Preview in Safe Mode to preview the project in safe mode.
    • To cancel opening the project, click Don't Open.
  5. If there is already an active project in the window, a confirmation message is displayed.
    • Click This Window to open the newly created project in the current window.
    • Click New Window to open the newly created project in a new window.