yeandy commented on code in PR #17470:
URL: https://github.com/apache/beam/pull/17470#discussion_r878085542


##########
sdks/python/apache_beam/ml/inference/pytorch.py:
##########
@@ -39,25 +42,47 @@ class PytorchInferenceRunner(InferenceRunner):
   def __init__(self, device: torch.device):
     self._device = device
 
-  def run_inference(self, batch: List[torch.Tensor],
-                    model: torch.nn.Module) -> Iterable[PredictionResult]:
+  def run_inference(
+      self,
+      batch: List[Union[torch.Tensor, Dict[str, torch.Tensor]]],
+      model: torch.nn.Module,
+      prediction_params: Optional[Dict[str, Any]] = None,

Review Comment:
   Unfortunately, I get this lint warning `Dangerous default value {} as 
argument (dangerous-default-value)`. 
   
   Some explanations on why setting to `{}` is not good practice:
   
https://stackoverflow.com/questions/26320899/why-is-the-empty-dictionary-a-dangerous-default-value-in-python
   
https://stackoverflow.com/questions/51710037/how-should-i-use-the-optional-type-hint/51710151#51710151
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to