You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/06/15 18:38:09 UTC

[GitHub] [beam] AnandInguva commented on a diff in pull request #21868: Updated documentation for ml.inference docs.

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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org