damccorm commented on code in PR #29016:
URL: https://github.com/apache/beam/pull/29016#discussion_r1365584838


##########
sdks/python/apache_beam/ml/transforms/tft.py:
##########
@@ -626,6 +577,10 @@ def apply_transform(self, data: tf.SparseTensor, 
output_col_name: str):
         data, self.ngram_range, self.ngrams_separator, self.name)
     return {output_col_name: output}
 
+  def get_artifacts(self, data: tf.SparseTensor,
+                    col_name: str) -> Dict[str, tf.Tensor]:
+    return self.compute_word_count_fn(data, col_name)

Review Comment:
   Why do we still need this one?



##########
sdks/python/apache_beam/ml/transforms/tft_test.py:
##########
@@ -130,7 +125,6 @@ def test_ScaleTo01_list(self):
           | "MLTransform" >> base.MLTransform(
               write_artifact_location=self.artifact_location).with_transform(
                   tft.ScaleTo01(columns=['x'])))
-      _ = (list_result | beam.Map(assert_ScaleTo01_artifacts))

Review Comment:
   Rather than removing all of these checks, can we check that the written 
artifact is correct?



##########
sdks/python/apache_beam/ml/transforms/tft.py:
##########
@@ -280,14 +271,6 @@ def __init__(
     self.elementwise = elementwise
     self.name = name
 
-  def get_artifacts(self, data: common_types.TensorType,
-                    col_name: str) -> Dict[str, common_types.TensorType]:
-    shape = [tf.shape(data)[0], 1]
-    return {
-        col_name + '_min': tf.broadcast_to(tft.min(data), shape),
-        col_name + '_max': tf.broadcast_to(tft.max(data), shape)
-    }
-

Review Comment:
   Can we rip this out at a higher level (e.g. 
https://github.com/apache/beam/blob/f0e0c2fc8a9a74bb051c922ef0f42c3ff494ee65/sdks/python/apache_beam/ml/transforms/base.py#L87)?



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