Skip to content

Commit

Permalink
fix categorify c++ op not working with new tensor conversions
Browse files Browse the repository at this point in the history
  • Loading branch information
jperez999 committed Jun 11, 2024
1 parent c7c83b1 commit 3605e02
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions merlin/dag/executors.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
)
from merlin.dag import ColumnSelector, DataFormats, Graph, Node
from merlin.dag.ops.stat_operator import StatOperator
from merlin.dag.utils import group_values_offsets
from merlin.dtypes.shape import DefaultShapes
from merlin.io import Dataset
from merlin.io.worker import clean_worker_cache
Expand Down Expand Up @@ -119,7 +120,11 @@ def _execute_node(self, node, transformable, capture_dtypes=False, strict=False)
upstream_columns = self._append_addl_root_columns(node, transformable, upstream_outputs)
formatted_columns = self._standardize_formats(node, upstream_columns)
transform_input = self._merge_upstream_columns(formatted_columns)
if "CategorifyTransform" in str(node.op):
transform_input = group_values_offsets(transform_input)
transform_output = self._run_node_transform(node, transform_input, capture_dtypes, strict)
if "CategorifyTransform" in str(node.op):
transform_output = TensorTable(transform_output)
transform_output = _convert_format(transform_output, self.target_format)
return transform_output

Expand Down Expand Up @@ -672,5 +677,6 @@ def _convert_format(tensors, target_format):
return tensors.to_df()
elif format_ in [DataFormats.NUMPY_DICT_ARRAY, DataFormats.CUPY_DICT_ARRAY]:
return TensorTable(tensors).cpu().to_df()


raise ValueError("unsupported target for converting tensors", target_format)

0 comments on commit 3605e02

Please sign in to comment.