Fix bug in `check_empty_containers` (#63492)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/63492
Test Plan: Imported from OSS
Reviewed By: bdhirsh
Differential Revision: D30402749
Pulled By: ansley
fbshipit-source-id: 7de533355fe91ca4f45b2bafc3bfb205a028c1ed