PyTorch
作者 pcloudhosting
Version 2.11.0 + Free with Support on Ubuntu 26.04
PyTorch is an open-source deep learning framework used to build, train, and deploy machine learning and artificial intelligence models. It provides flexible tensor computation, automatic differentiation, neural network tools, and support for CPU and GPU-based workloads.
This solution supports common AI and deep learning workflows including model development, tensor operations, neural network training, GPU acceleration, research experimentation, and production-ready machine learning applications. It is ideal for developers, data scientists, researchers, and AI engineers working on Azure Ubuntu virtual machines.
Version: PyTorch 2.11.0
Features of PyTorch:
- Open-source framework for deep learning and machine learning workloads.
- Supports tensor computation with CPU and GPU acceleration.
- Includes automatic differentiation for neural network training.
- Provides easy integration with TorchVision and TorchAudio.
- Supports model building, training, testing, and deployment workflows.
- Suitable for research, prototyping, and production AI applications.
Usage instructions for PyTorch
$ sudo su
$ source /root/pytorch-env/bin/activate
$ python -c "import torch; print(torch.__version__)"
$ python -c "import torch; print(torch.cuda.is_available())"
Check installed version:
python - <<'PY'
import torch
print("PyTorch Version:", torch.__version__)
print("CUDA Build:", torch.version.cuda)
print("CUDA Available:", torch.cuda.is_available())
if torch.cuda.is_available():
print("GPU:", torch.cuda.get_device_name(0))
else:
print("GPU: Not available / CPU mode")
PY
Test PyTorch installation:
python - <<'PY'
import torch
x = torch.rand(5, 3)
print(x)
if torch.cuda.is_available():
y = torch.rand(5, 3, device="cuda")
print("GPU tensor test:")
print(y)
print("PyTorch GPU test: PASSED")
else:
print("PyTorch CPU test: PASSED")
PY
Access the application: PyTorch is a command-line and Python library-based framework. Use it from the activated Python virtual environment on your Azure Ubuntu VM.
Disclaimer: PyTorch is provided “as is” under applicable open-source licenses. Users are responsible for validating model behavior, securing their Azure environment, managing dependencies, and ensuring appropriate use of CPU or GPU resources. This solution is best suited for machine learning, deep learning, AI research, and model development workloads.