From eb6af305d62f233bc70a313f8c24ef5088d4bac6 Mon Sep 17 00:00:00 2001 From: Qiao Longfei Date: Sun, 10 Mar 2019 23:18:09 +0800 Subject: [PATCH] change embedding interface addnremote_prefetch --- python/paddle/fluid/layers/nn.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/paddle/fluid/layers/nn.py b/python/paddle/fluid/layers/nn.py index efb400ccc6d..48a46a0ff02 100644 --- a/python/paddle/fluid/layers/nn.py +++ b/python/paddle/fluid/layers/nn.py @@ -306,7 +306,8 @@ def embedding(input, is_distributed=False, padding_idx=None, param_attr=None, - dtype='float32'): + dtype='float32', + remote_prefetch=False): """ **Embedding Layer** @@ -345,7 +346,7 @@ def embedding(input, """ helper = LayerHelper('embedding', **locals()) - remote_prefetch = is_sparse and (not is_distributed) + remote_prefetch = is_sparse and (not is_distributed) and remote_prefetch if remote_prefetch: assert is_sparse is True and is_distributed is False w = helper.create_parameter( -- GitLab