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