Skip to content

zhtmike/MSConverter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MS Converter

MS Converter can replace PyTorch interfaces in scripts with MindSpore (>=2.5) Mint interfaces, reducing repetitive tasks and improving development efficiency. :D

Disclaimer: The converted script may not necessarily run successfully.

Installation

Install from Git

pip install git+https://github.com/zhtmike/MSConverter.git

Usage

You can simply run the following command to show the updated script in the terminal

torch2mint your_pytorch_script.py

To update the script in place, run

torch2mint -i your_pytorch_script.py

To select different Mindspore version (e.g. v2.6.0) for API mapping, run

torch2mint --ms-version 2.6.0 your_pytorch_script.py

check torch2mint -h for the detail usage.

Note

  • To update the MindSpore Mint API list, download the .rst file from the MindSpore website (e.g., MindSpore 2.5.0 API List ), run

    torch2mint your_pytorch_script.py --mint-api-path your_mint_api_path.rst
  • To add conversion rules, simply add a json file with the content

    {"the content you want to replace": "the content you want to fill"}

    similar to assets/mapping.json, then run

    torch2mint your_pytorch_script.py --custom-mapping-path your_custom_mapping_path.json

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages