Fix deviceCount on FakeGuardImpl. (#18745)
authorEdward Yang <ezyang@fb.com>
Thu, 4 Apr 2019 16:20:20 +0000 (09:20 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Thu, 4 Apr 2019 16:23:36 +0000 (09:23 -0700)
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

c10/core/impl/FakeGuardImpl.h

index 7c18c8d..6e6f22c 100644 (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() {