Merge pull request !1842 from jiangjinsheng/issue_doctags/v0.5.0-beta
| @@ -250,7 +250,7 @@ class LeakyReLU(Cell): | |||||
| def construct(self, x): | def construct(self, x): | ||||
| alpha = P.Cast()(F.scalar_to_array(self.alpha), P.DType()(x)) | alpha = P.Cast()(F.scalar_to_array(self.alpha), P.DType()(x)) | ||||
| if self.alpha <= 1: | |||||
| if alpha <= 1: | |||||
| out = P.Maximum()(alpha * x, x) | out = P.Maximum()(alpha * x, x) | ||||
| else: | else: | ||||
| out = P.Minimum()(alpha * x, x) | out = P.Minimum()(alpha * x, x) | ||||
| @@ -45,8 +45,8 @@ class Embedding(Cell): | |||||
| Inputs: | Inputs: | ||||
| - **input** (Tensor) - Tensor of shape :math:`(\text{batch_size}, \text{input_length})`. The element of | - **input** (Tensor) - Tensor of shape :math:`(\text{batch_size}, \text{input_length})`. The element of | ||||
| the Tensor should be integer and not larger than vocab_size. else the corresponding embedding vector is zero | |||||
| if larger than vocab_size. | |||||
| the Tensor should be integer and not larger than vocab_size. else the corresponding embedding vector is zero | |||||
| if larger than vocab_size. | |||||
| Outputs: | Outputs: | ||||
| Tensor of shape :math:`(\text{batch_size}, \text{input_length}, \text{embedding_size})`. | Tensor of shape :math:`(\text{batch_size}, \text{input_length}, \text{embedding_size})`. | ||||
| @@ -93,13 +93,13 @@ class Optimizer(Cell): | |||||
| if isinstance(loss_scale, int): | if isinstance(loss_scale, int): | ||||
| loss_scale = float(loss_scale) | loss_scale = float(loss_scale) | ||||
| validator.check_value_type("loss_scale", loss_scale, [float], None) | |||||
| validator.check_number_range("loss_scale", loss_scale, 0.0, float("inf"), Rel.INC_NEITHER, None) | |||||
| validator.check_value_type("loss_scale", loss_scale, [float], self.cls_name) | |||||
| validator.check_number_range("loss_scale", loss_scale, 0.0, float("inf"), Rel.INC_NEITHER, self.cls_name) | |||||
| if isinstance(weight_decay, int): | if isinstance(weight_decay, int): | ||||
| weight_decay = float(weight_decay) | weight_decay = float(weight_decay) | ||||
| validator.check_value_type("weight_decay", weight_decay, [float], None) | |||||
| validator.check_number_range("weight_decay", weight_decay, 0.0, float("inf"), Rel.INC_LEFT, None) | |||||
| validator.check_value_type("weight_decay", weight_decay, [float], self.cls_name) | |||||
| validator.check_number_range("weight_decay", weight_decay, 0.0, float("inf"), Rel.INC_LEFT, self.cls_name) | |||||
| self.is_group = False | self.is_group = False | ||||
| self.is_group_lr = False | self.is_group_lr = False | ||||