Skip to content

Commit

Permalink
Add constructor to MockSharding that also takes device list to allow …
Browse files Browse the repository at this point in the history
…tests that need working call to Sharding::devices().

PiperOrigin-RevId: 675704343
  • Loading branch information
Google-ML-Automation committed Sep 17, 2024
1 parent 95447c0 commit bc1aad8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions xla/python/ifrt/mock.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,11 @@ class MockSharding : public llvm::RTTIExtends<MockSharding, Sharding> {
BasicDeviceList::Create({}), MemoryKind(),
/*is_fully_replicated=*/false) {}

MockSharding(tsl::RCReference<DeviceList> devices, MemoryKind memory_kind,
bool is_fully_replicated)
: llvm::RTTIExtends<MockSharding, Sharding>(devices, memory_kind,
is_fully_replicated) {}

MOCK_METHOD(
(absl::StatusOr<
std::vector<std::pair<Shape, std::shared_ptr<const Sharding>>>>),
Expand Down

0 comments on commit bc1aad8

Please sign in to comment.