An option is to remove torch from Pylint. Based on a similar solution for numpy 522, you can add the following config to your settings.
{
    // whitelist torch to remove lint errors
    "python.linting.pylintArgs": [
        "--extension-pkg-whitelist=torch"
    ]
}

A more proper approach might be to fix the Pylint issue with PyTorch, but I don’t know what’s exactly causing this problem (maybe torch functions are not statically resolvable).