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


##########
sdks/python/apache_beam/ml/inference/pytorch.py:
##########
@@ -39,25 +41,63 @@ 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 _convert_to_device(self, examples: torch.Tensor) -> torch.Tensor:
+    """
+    examples, which may or may not be attached to GPU during creation time, 
need

Review Comment:
   Thanks for the feedback. This is much cleaner. Fixed.



-- 
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