diff --git a/mindspore/nn/layer/basic.py b/mindspore/nn/layer/basic.py index d688c6a2bdf..0309fc5552b 100644 --- a/mindspore/nn/layer/basic.py +++ b/mindspore/nn/layer/basic.py @@ -93,9 +93,7 @@ class Dropout(Cell): self.dropout_do_mask = P.DropoutDoMask() self.cast = P.Cast() self.is_gpu = context.get_context('device_target') in ["GPU"] - - if self.is_gpu: - self.dropout = P.Dropout(keep_prob) + self.dropout = P.Dropout(keep_prob) def construct(self, x): if not self.training: diff --git a/mindspore/nn/layer/embedding.py b/mindspore/nn/layer/embedding.py index 83241239f3b..f5be4d9a258 100755 --- a/mindspore/nn/layer/embedding.py +++ b/mindspore/nn/layer/embedding.py @@ -128,8 +128,10 @@ class EmbeddingLookup(Cell): vocab_size (int): Size of the dictionary of embeddings. embedding_size (int): The size of each embedding vector. param_init (str): The initialize way of embedding table. Default: 'normal'. - target (str): Specify the target where the op is executed. Default: 'CPU'. - slice_mode (str): The slicing way in semi auto parallel/auto parallel. Default: 'batch_slice'. + target (str): Specify the target where the op is executed. The value should in + ['DEVICE', 'CPU']. Default: 'CPU'. + slice_mode (str): The slicing way in semi auto parallel/auto parallel. The value should get through + nn.EmbeddingLookUpSplitMode. Default: 'batch_slice'. manual_shapes (tuple): The accompaniment array in field slice mode. Inputs: