Skip to content

Commit

Permalink
suppress errors in reagent
Browse files Browse the repository at this point in the history
Differential Revision: D49531141

fbshipit-source-id: 04bbaa63baf038b537aee2d76d1601d048fa0e99
  • Loading branch information
generatedunixname89002005307016 authored and facebook-github-bot committed Sep 22, 2023
1 parent fbe1abd commit fd4f5cc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions reagent/ope/estimators/slate_estimators.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,7 @@ def slot_item_expectations(self, samples: int = 20000) -> SlateSlotItemExpectati
# ...]]` but got `Union[bool, float, int]`.
dist[item] = 1.0
dists.append(value.replace(dist))
# pyre-fixme[6]: For 1st argument expected `Union[None, _NestedSequen...
ps[torch.arange(i + 1, slate_size), item] = 0.0
self._slot_item_expectations = make_slot_item_distributions(
self.slots, dists
Expand Down Expand Up @@ -662,11 +663,13 @@ def sample_slate(self, slots: SlateSlots) -> Slate:
for i, value in zip(range(slate_size), self._values):
item = ps[i].argmax().item()
items.append(value.items[item])
# pyre-fixme[6]: For 1st argument expected `Union[None, _NestedSequen...
ps[torch.arange(i + 1, slate_size), item] = 0.0
else:
for i, value in zip(range(slate_size), self._values):
item = ps[i].multinomial(1).item()
items.append(value.items[item])
# pyre-fixme[6]: For 1st argument expected `Union[None, _NestedSequen...
ps[torch.arange(i + 1, slate_size), item] = 0.0
return make_slate(slots, items)

Expand Down

0 comments on commit fd4f5cc

Please sign in to comment.