From 2c4d1afe14d3e6b2abc8a2512283600091e4048d Mon Sep 17 00:00:00 2001 From: Megvii Engine Team Date: Fri, 3 Apr 2020 15:32:34 +0800 Subject: [PATCH] test(mge): move `NUMBER` config to pytest.init GitOrigin-RevId: 1d82209c409ccf884ed9f7917a51ea4da62ec00b --- python_module/megengine/functional/math.py | 1 - python_module/megengine/functional/nn.py | 1 - python_module/megengine/functional/sort.py | 2 -- python_module/megengine/functional/utils.py | 1 - python_module/megengine/module/activation.py | 7 +++---- python_module/megengine/module/embedding.py | 3 +-- 6 files changed, 4 insertions(+), 11 deletions(-) diff --git a/python_module/megengine/functional/math.py b/python_module/megengine/functional/math.py index c92f9890..2ebac2f6 100644 --- a/python_module/megengine/functional/math.py +++ b/python_module/megengine/functional/math.py @@ -190,7 +190,6 @@ def sqrt(inp: Tensor) -> Tensor: Outputs: .. testoutput:: - :options: +NUMBER [[0. 1. 1.4142] [1.7321 2. 2.2361 ]] diff --git a/python_module/megengine/functional/nn.py b/python_module/megengine/functional/nn.py index a194d9c6..d781fef1 100644 --- a/python_module/megengine/functional/nn.py +++ b/python_module/megengine/functional/nn.py @@ -636,7 +636,6 @@ def interpolate( Outputs: .. testoutput:: - :options: +NUMBER [[[[1. 1.25 1.75 2. ] [1.5 1.75 2.25 2.5 ] diff --git a/python_module/megengine/functional/sort.py b/python_module/megengine/functional/sort.py index f306b1fe..70597d52 100644 --- a/python_module/megengine/functional/sort.py +++ b/python_module/megengine/functional/sort.py @@ -39,7 +39,6 @@ def argsort(inp: Tensor, descending: bool = False) -> Tuple[Tensor, Tensor]: Outputs: .. testoutput:: - :options: +NUMBER [1. 2.] [0 1] @@ -93,7 +92,6 @@ def top_k( Outputs: .. testoutput:: - :options: +NUMBER [1. 2. 3. 4. 5.] [7 0 6 1 5] diff --git a/python_module/megengine/functional/utils.py b/python_module/megengine/functional/utils.py index 5a54756d..b490eb2f 100644 --- a/python_module/megengine/functional/utils.py +++ b/python_module/megengine/functional/utils.py @@ -50,7 +50,6 @@ def accuracy(logits: Tensor, target: Tensor, topk: Union[int, Iterable[int]] = 1 Outputs: .. testoutput:: - :options: +NUMBER [0.] [0.375] """ diff --git a/python_module/megengine/module/activation.py b/python_module/megengine/module/activation.py index 73a7efb9..8240c488 100644 --- a/python_module/megengine/module/activation.py +++ b/python_module/megengine/module/activation.py @@ -20,7 +20,7 @@ class Softmax(Module): .. math:: \text{Softmax}(x_{i}) = \frac{exp(x_i)}{\sum_j exp(x_j)} - It is applied to an n-dimensional input Tensor and rescaling them so that the elements of the + It is applied to an n-dimensional input Tensor and rescaling them so that the elements of the n-dimensional output Tensor lie in the range of `[0, 1]` and sum to 1. :param axis: An axis along which softmax will be applied. By default, @@ -137,8 +137,8 @@ class PReLU(Module): ax, & \text{ otherwise } \end{cases} - Here :math:`a` is a learnable parameter. When called without arguments, `PReLU()` uses - a single paramter :math:`a` across all input channel. If called with `PReLU(num_of_channels)`, + Here :math:`a` is a learnable parameter. When called without arguments, `PReLU()` uses + a single paramter :math:`a` across all input channel. If called with `PReLU(num_of_channels)`, a seperate :math:`a` is used for each input channle. :param num_parameters: number of :math:`a` to learn, there is only two @@ -218,7 +218,6 @@ class LeakyReLU(Module): Outputs: .. testoutput:: - :options: +NUMBER [-0.08 -0.12 6. 10. ] diff --git a/python_module/megengine/module/embedding.py b/python_module/megengine/module/embedding.py index 806ae0e4..976ac125 100644 --- a/python_module/megengine/module/embedding.py +++ b/python_module/megengine/module/embedding.py @@ -21,7 +21,7 @@ class Embedding(Module): A simple lookup table that stores embeddings of a fixed dictionary and size. This module is often used to store word embeddings and retrieve them using indices. - The input to the module is a list of indices, and the output is the corresponding word embeddings. + The input to the module is a list of indices, and the output is the corresponding word embeddings. The indices should less than num_embeddings. :param num_embeddings: size of embedding dictionary. @@ -138,7 +138,6 @@ class Embedding(Module): Outputs: .. testoutput:: - :options: +NUMBER [[[1.2 2.3 3.4 4.5 5.6] [0.1 1.1 2.1 3.1 4.1] -- GitLab