Skip to content

Commit 3f4815c

Browse files
generatedunixname1228101065403401meta-codesync[bot]
authored andcommitted
Fix PYRE_FIXME issue in fbcode/pearl/test/unit/with_pytorch/test_neural_linear_bandits.py
Differential Revision: D103582647 fbshipit-source-id: 75cae225364ad1cd124d6ceb63d61a96e68a92be
1 parent 0831984 commit 3f4815c

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

test/unit/with_pytorch/test_neural_linear_bandits.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,18 +229,18 @@ def test_discounting(self) -> None:
229229
for _ in range(num_reps):
230230
policy_learner.learn_batch(batch)
231231

232+
weight = batch.weight
233+
assert weight is not None
232234
self.assertLess(
233235
policy_learner.model._linear_regression_layer.A[0, 0].item(),
234236
# pyre-fixme[58]: `*` is not supported for operand types `int` and
235237
# `Union[bool, float, int]`.
236-
# pyre-fixme[6]: For 1st argument expected `Tensor` but got
237-
# `Optional[Tensor]`.
238-
num_reps * torch.sum(batch.weight).item(),
238+
num_reps * torch.sum(weight).item(),
239239
)
240240
self.assertLess(
241241
# pyrefly: ignore [bad-index]
242242
policy_learner.model._linear_regression_layer._b[0].item(),
243243
# pyre-fixme[58]: `*` is not supported for operand types `int` and
244244
# `Union[bool, float, int]`.
245-
num_reps * torch.sum(batch.reward * batch.weight).item(),
245+
num_reps * torch.sum(batch.reward * weight).item(),
246246
)

0 commit comments

Comments
 (0)