Fix deprecation warnings for int div
Co-authored-by: mgoldey <matthew.goldey@gmail.com>

# What does this PR do?

This PR fixes the int div warnings by using the new API in PyTorch for versions >= 1.8 all the while keeping backward compatibility with older versions.

Supersedes #14577