diff --git a/python/paddle/fluid/layers/nn.py b/python/paddle/fluid/layers/nn.py index 6379031ee49a7ae79fdfa7ac3b045781ee95545e..9af62bf06fcd8e59ddbf2350dc87ee44863ffdb2 100644 --- a/python/paddle/fluid/layers/nn.py +++ b/python/paddle/fluid/layers/nn.py @@ -336,9 +336,7 @@ def embedding(input, """ helper = LayerHelper('embedding', **locals()) - remote_prefetch = False - if os.environ.get('PADDLE_ENABLE_REMOTE_PREFETCH'): - remote_prefetch = True + remote_prefetch = is_sparse if remote_prefetch: assert is_sparse is True and is_distributed is False w = helper.create_parameter(