AnandInguva commented on code in PR #21868:
URL: https://github.com/apache/beam/pull/21868#discussion_r898290184


##########
sdks/python/apache_beam/ml/inference/pytorch_inference.py:
##########
@@ -190,6 +194,10 @@ def run_inference(
     For the same key across all examples, this will stack all Tensors values
     in a vectorized format to optimize the inference call.
 
+    Args:
+      batch: A sequence of Tensors.
+      model: A pytorch model.

Review Comment:
   Do we need to explicitly say `Must implement forward(X)`?  
   
   Also Users passes X as `dict` when the forward call of the model requires 
multiple positional arguments. If `X` is a `dict`, we unpack the positional 
arguments to the forward call in RunInference API by calling `model(**X)` which 
implicitly means `model.forward(**X)`. I think line 200 would confuse the users 
on this behavior.



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