Skip to content

Commit 6efa8ff

Browse files
generatedunixname89002005307016facebook-github-bot
authored andcommitted
suppress errors in reagent
Reviewed By: connernilsen Differential Revision: D53101150 fbshipit-source-id: 8aa3785abe2af77b304dd0cd1f4605f0f9b24dec
1 parent d0cb051 commit 6efa8ff

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

reagent/ope/estimators/slate_estimators.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,7 @@ def slate_space(
538538
if max_size <= 0 or max_size > len(next_buffer):
539539
buffer = next_buffer
540540
else:
541+
# pyre-fixme[20]: Argument `k` expected.
541542
buffer = random.sample(next_buffer, max_size)
542543
return [([SlateItem(i) for i in b[0]], b[1]) for b in buffer]
543544

reagent/ope/estimators/types.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,12 @@ class TypeWrapper(Generic[ValueType]):
2828

2929
def __index__(self) -> int:
3030
try:
31-
# pyre-fixme[6]: For 1st param expected `Union[_SupportsTrunc, bytes,
32-
# str, SupportsInt, SupportsIndex]` but got `ValueType`.
3331
return int(self.value)
3432
except Exception:
3533
raise ValueError(f"{self} cannot be used as index")
3634

3735
def __int__(self) -> int:
3836
try:
39-
# pyre-fixme[6]: For 1st param expected `Union[_SupportsTrunc, bytes,
40-
# str, SupportsInt, SupportsIndex]` but got `ValueType`.
4137
return int(self.value)
4238
except Exception:
4339
raise ValueError(f"{self} cannot be converted to int")
@@ -172,8 +168,6 @@ def _values_copy(self) -> Sequence[ValueType]:
172168
def index_of(self, key: KeyType) -> int:
173169
if self._key_to_index is None:
174170
try:
175-
# pyre-fixme[6]: Expected `Union[_SupportsIndex, bytes, str,
176-
# typing.SupportsInt]` for 1st param but got `KeyType`.
177171
index = int(key)
178172
if 0 <= index < len(self):
179173
return index

reagent/ope/test/multiclass_bandits.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,13 @@ def train_val_test_split(
135135
):
136136
total_len = len(self._data_frame)
137137
train_len = int(total_len * ratios[0])
138+
# pyre-fixme[20]: Argument `k` expected.
138139
train_choices = random.sample(range(total_len), train_len)
139140
train_x = np.take(self._features, train_choices, axis=0)
140141
train_y = np.take(self._class_indices, train_choices)
141142
train_r = np.take(self._one_hots, train_choices, axis=0)
142143
fit_len = int(train_len * ratios[1])
144+
# pyre-fixme[20]: Argument `k` expected.
143145
fit_choices = random.sample(range(train_len), fit_len)
144146
fit_x = np.take(train_x, fit_choices, axis=0)
145147
fit_y = np.take(train_y, fit_choices)
@@ -260,6 +262,7 @@ def evaluate_all(
260262
for estimators, num_samples in experiments:
261263
samples = []
262264
for _ in range(num_samples):
265+
# pyre-fixme[20]: Argument `k` expected.
263266
qid = random.sample(test_queries, 1)
264267
label = int(dataset.labels[qid].item())
265268
log_action, log_action_probabilities = log_policy(qid)

0 commit comments

Comments
 (0)