This is an automated email from the ASF dual-hosted git repository.

bhulette pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new 3494c8c6d48 Update documentations and document generation (#21965)
3494c8c6d48 is described below

commit 3494c8c6d48dd88fd2a15ba8ff8997a4c8fc1e4c
Author: Ryan Thompson <[email protected]>
AuthorDate: Tue Jun 21 17:30:08 2022 -0400

    Update documentations and document generation (#21965)
---
 sdks/python/apache_beam/ml/inference/base.py              | 5 +++++
 sdks/python/apache_beam/ml/inference/pytorch_inference.py | 1 +
 sdks/python/scripts/generate_pydoc.sh                     | 8 ++++----
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/sdks/python/apache_beam/ml/inference/base.py 
b/sdks/python/apache_beam/ml/inference/base.py
index 371dc341647..9f1068eebd1 100644
--- a/sdks/python/apache_beam/ml/inference/base.py
+++ b/sdks/python/apache_beam/ml/inference/base.py
@@ -67,6 +67,11 @@ PredictionResult = NamedTuple(
         ('example', _INPUT_TYPE),
         ('inference', _OUTPUT_TYPE),
     ])
+PredictionResult.__doc__ = """A NamedTuple containing both input and output
+  from the inference."""
+PredictionResult.example.__doc__ = """The input example."""
+PredictionResult.inference.__doc__ = """Results for the inference on the model
+  for the given example."""
 
 
 def _to_milliseconds(time_ns: int) -> int:
diff --git a/sdks/python/apache_beam/ml/inference/pytorch_inference.py 
b/sdks/python/apache_beam/ml/inference/pytorch_inference.py
index 0847f8d96c4..6875737a56d 100644
--- a/sdks/python/apache_beam/ml/inference/pytorch_inference.py
+++ b/sdks/python/apache_beam/ml/inference/pytorch_inference.py
@@ -172,6 +172,7 @@ class PytorchModelHandlerKeyedTensor(ModelHandler[Dict[str, 
torch.Tensor],
       device: the device on which you wish to run the model. If
         ``device = GPU`` then a GPU device will be used if it is available.
         Otherwise, it will be CPU.
+      model_params: A dictionary of parameters passed in to the model class.
     """
     self._state_dict_path = state_dict_path
     if device == 'GPU' and torch.cuda.is_available():
diff --git a/sdks/python/scripts/generate_pydoc.sh 
b/sdks/python/scripts/generate_pydoc.sh
index a097caebefa..0607fe8598b 100755
--- a/sdks/python/scripts/generate_pydoc.sh
+++ b/sdks/python/scripts/generate_pydoc.sh
@@ -252,8 +252,8 @@ EOF
 # documentation verbatim.
 python $(type -p sphinx-build) -v -a -E -q target/docs/source \
   target/docs/_build -c target/docs/source \
-  |& grep -E -v 'apache_beam\.dataframe.*WARNING:' \
-  |& tee "target/docs/sphinx-build.log"
+  2>&1 | grep -E -v 'apache_beam\.dataframe.*WARNING:' \
+  2>&1 | tee "target/docs/sphinx-build.log"
 
 # Fail if there are errors or warnings in docs
 ! grep -q "ERROR:" target/docs/sphinx-build.log || exit 1
@@ -264,8 +264,8 @@ python $(type -p sphinx-build) -v -a -E -q 
target/docs/source \
 # - Interactive code starting with '>>>'
 python -msphinx -M doctest target/docs/source \
   target/docs/_build -c target/docs/source \
-  |& grep -E -v 'apache_beam\.dataframe.*WARNING:' \
-  |& tee "target/docs/sphinx-doctest.log"
+  2>&1 | grep -E -v 'apache_beam\.dataframe.*WARNING:' \
+  2>&1 | tee "target/docs/sphinx-doctest.log"
 
 # Fail if there are errors or warnings in docs
 ! grep -q "ERROR:" target/docs/sphinx-doctest.log || exit 1

Reply via email to