How to use 'check pytorch version' in Python

Every line of 'check pytorch version' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
56def torch_version():
57 if args.cpu:
58 if c.get_os() == c.OS.LINUX:
59 return "https://download.pytorch.org/whl/cpu/torch-1.1.0-cp{0}{1}-cp{0}{1}m-linux_x86_64.whl".format(
60 *c.get_python_version())
61 if c.get_os() == c.OS.MAC:
62 return "torch"
63 if c.get_os() == c.OS.WIN:
64 return "https://download.pytorch.org/whl/cpu/torch-1.1.0-cp{0}{1}-cp{0}{1}m-win_amd64.whl".format(
65 *c.get_python_version())
66 else:
67 if c.get_os() == c.OS.LINUX:
68 return "https://download.pytorch.org/whl/cu100/torch-1.1.0-cp{0}{1}-cp{0}{1}m-linux_x86_64.whl".format(
69 *c.get_python_version())
70 if c.get_os() == c.OS.MAC:
71 c.log.warning(
72 "# MacOS Binaries dont support CUDA, install from source if CUDA is needed. "
73 "This script will install the cpu version.")
74 return "torch"
75 if c.get_os() == c.OS.WIN:
76 return "https://download.pytorch.org/whl/cu100/torch-1.1.0-cp{0}{1}-cp{0}{1}m-win_amd64.whl".format(
77 *c.get_python_version())

Related snippets