From 8cfed4a1cb03d1844efccbc76af2d8c2acad53de Mon Sep 17 00:00:00 2001 From: Megvii Engine Team Date: Mon, 15 Mar 2021 15:28:06 +0800 Subject: [PATCH] refactor(functional/nn): remove nn.svd GitOrigin-RevId: 4f58e10a1fed040c03cd466eae5f65e8d78f5630 --- imperative/python/megengine/functional/nn.py | 32 ---------------------------- 1 file changed, 32 deletions(-) diff --git a/imperative/python/megengine/functional/nn.py b/imperative/python/megengine/functional/nn.py index c8b40bc5..c1ea0a10 100644 --- a/imperative/python/megengine/functional/nn.py +++ b/imperative/python/megengine/functional/nn.py @@ -63,7 +63,6 @@ __all__ = [ "prelu", "softmax", "softplus", - "svd", "sync_batch_norm", "conv1d", "sigmoid", @@ -1222,37 +1221,6 @@ def dot(inp1: Tensor, inp2: Tensor) -> Tensor: return result -def svd(inp: Tensor, full_matrices=False, compute_uv=True) -> Tensor: - """ - Computes the singular value decompositions of input matrix. - - :param inp: input matrix, must has shape `[..., M, N]`. - :return: output matrices, `(U, sigma, V)`. - - Examples: - - .. testcode:: - - import numpy as np - from megengine import tensor - import megengine.functional as F - - x = tensor(np.arange(0, 6, dtype=np.float32).reshape(2,3)) - _, y, _ = F.svd(x) - print(y.numpy().round(decimals=3)) - - Outputs: - - .. testoutput:: - - [7.348 1. ] - - """ - op = builtin.SVD(full_matrices=full_matrices, compute_uv=compute_uv) - U, sigma, V = apply(op, inp) - return U, sigma, V - - def dropout(inp: Tensor, drop_prob: float, training: bool = True) -> Tensor: """ Returns a new tensor where each of the elements are randomly set to zero