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