Fix deviceCount on FakeGuardImpl. (#18745)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18745
ghimport-source-id: 3ed111efe83b3061652869e33d9b5910b7daa732

Differential Revision: D14759198

Pulled By: ezyang

fbshipit-source-id: 70a8db767f310fe0e0079c7b0693e9330d7cd472
This commit is contained in:
Edward Yang
2019-04-04 09:20:20 -07:00
committed by Facebook Github Bot
parent 486fae563d
commit 52a3a51490

View File

@ -55,7 +55,7 @@ struct FakeGuardImpl final : public DeviceGuardImplInterface {
return Stream(Stream::UNSAFE, s.device(), old_id);
}
DeviceIndex deviceCount() const noexcept override {
return 1;
return kFakeGuardImplMaxDevices;
}
// Convenience methods for testing
static DeviceIndex getDeviceIndex() {