File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -234,20 +234,16 @@ def test_discounting(self) -> None:
234234 for _ in range (num_reps ):
235235 policy_learner .learn_batch (self .batch )
236236
237+ weight = self .batch .weight
238+ assert weight is not None
237239 self .assertLess (
238240 policy_learner .model .A [0 , 0 ].item (),
239- # pyre-fixme[58]: `*` is not supported for operand types `int` and
240- # `Union[bool, float, int]`.
241- # pyre-fixme[6]: For 1st argument expected `Tensor` but got
242- # `Optional[Tensor]`.
243- num_reps * torch .sum (self .batch .weight ).item (),
241+ num_reps * float (torch .sum (weight ).item ()),
244242 )
245243 self .assertLess (
246244 # pyrefly: ignore [bad-index]
247245 policy_learner .model ._b [0 ].item (),
248- # pyre-fixme[58]: `*` is not supported for operand types `int` and
249- # `Union[bool, float, int]`.
250- num_reps * torch .sum (self .batch .reward * self .batch .weight ).item (),
246+ num_reps * float (torch .sum (self .batch .reward * weight ).item ()),
251247 )
252248
253249 def test_unobserved_actions (self ) -> None :
You can’t perform that action at this time.
0 commit comments