damccorm commented on code in PR #23087:
URL: https://github.com/apache/beam/pull/23087#discussion_r966325894
##########
sdks/python/apache_beam/ml/inference/pytorch_inference_test.py:
##########
@@ -63,6 +63,17 @@
for f1, f2 in TWO_FEATURES_EXAMPLES]).reshape(-1, 1))
]
+TWO_FEATURES_DICT_OUT_PREDICTIONS = [
+ PredictionResult(ex, pred) for ex,
+ pred in zip(
+ TWO_FEATURES_EXAMPLES,
+ [{
+ "output1": torch.Tensor([f1 * 2.0 + f2 * 3 + 0.5]),
+ "output2": torch.Tensor([f1 * 2.0 + f2 * 3 + 0.5])
+ } for f1,
+ f2 in TWO_FEATURES_EXAMPLES])
+]
Review Comment:
That's probably fine - I was aiming for greater completeness/simplicty
modularity/DRY (see subheader [Make Your Tests Complete and
Concise](https://abseil.io/resources/swe-book/html/ch12.html) for a more
fleshed out philosophy), but I agree this ends up being better. Done
--
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]