check if pytorch is installed code example Example: get pytorch version import torch print(torch.__version__)