When test set_affinity, don't hardcode the CPU ID (#65042)
authorHong Xu <hong@topbug.net>
Wed, 15 Sep 2021 15:09:49 +0000 (08:09 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Wed, 15 Sep 2021 15:10:59 +0000 (08:10 -0700)
commitfb8bdb8039fe8dde4b3eea0a740c859f9dde7f87
tree7d0937422deb844eb5045091b8f6e3b0538cc9bc
parentc625f971d33cd01320ab1f04a0eee7fadc106c61
When test set_affinity, don't hardcode the CPU ID (#65042)

Summary:
The setaffinity test always fails when the number of CPUs is smaller
than 3. Changed the test to be dynamically based on the number of CPUs
of the system.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/65042

Reviewed By: jbschlosser

Differential Revision: D30960554

Pulled By: ejguan

fbshipit-source-id: 55ac12714b4b0964b48c3617b79a7a345d40ebce
test/test_dataloader.py