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


##########
sdks/python/apache_beam/ml/inference/pytorch_test.py:
##########
@@ -43,10 +43,14 @@
   raise unittest.SkipTest('PyTorch dependencies are not installed')
 
 
-def _compare_prediction_result(a, b):
-  return (
-      torch.equal(a.inference, b.inference) and
-      torch.equal(a.example, b.example))
+def _compare_prediction_result(x, y):

Review Comment:
   As opposed to the other pattern
   ```
   for actual, expected in zip(predictions, expected_predictions):
     self.assertTrue(_compare_prediction_result(actual, expected))
   ```
   which will won't return anything meaningful besides saying that `False` is 
not `True` (which I've already fixed), the call
   ```
   assert_that(
       predictions,
       equal_to(expected_predictions, equals_fn=_compare_prediction_result))
   ```
   will output the details of how `a` and `b` are not equal. So I will keep 
this function name the same.



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