Skip to content

Commit

Permalink
add conditional placement of feature column on cpu
Browse files Browse the repository at this point in the history
  • Loading branch information
chengmengli06 committed Feb 26, 2024
1 parent 93a25a6 commit 2955315
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion easy_rec/python/compat/feature_column/feature_column.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@
from tensorflow.python.util import nest

from easy_rec.python.compat.feature_column import utils as fc_utils
from easy_rec.python.utils import conditional
from easy_rec.python.utils import constant
from easy_rec.python.utils import embedding_utils

Expand Down Expand Up @@ -634,7 +635,7 @@ def _get_var_type(column):
if embedding_utils.is_embedding_parallel():
return _get_logits_embedding_parallel()
else:
with ops.device('/CPU:0'):
with conditional(embedding_utils.embedding_on_cpu(), '/cpu:0'):
return _get_logits()


Expand Down

0 comments on commit 2955315

Please sign in to comment.