torchvision 0.2.1 was released on April 24, 2018 based on the release notes 5, while is_valid_file was added on April 25 2019 in this PR 16 (so a year later).
Where did you find the docs which mention it in 0.2.1?