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


##########
sdks/python/apache_beam/ml/inference/base_test.py:
##########
@@ -72,6 +72,21 @@ def process(self, prediction_result):
     yield prediction_result.inference
 
 
+class FakeInferenceRunnerNeedsBigBatch(FakeInferenceRunner):
+  def run_inference(self, batch, unused_model):
+    if len(batch) < 100:
+      raise ValueError('Unexpectedly small batch')
+    return batch
+
+
+class FakeLoaderWithBatchArgForwarding(FakeModelLoader):
+  def get_inference_runner(self):
+    return FakeInferenceRunnerNeedsBigBatch()
+
+  def batch_elements_kwargs(self):
+    return {'min_batch_size': 9999}

Review Comment:
   If the goal is to be able to set a max batch size of 1, I think it might 
also be useful to explicitly test the case in which `batch_elements_kwargs` 
returns `{max_batch_size=1}`.



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