From f84e9ffb2c7b2829cf99cf777cf5d278ddb3f8fd Mon Sep 17 00:00:00 2001
From: Yabin Li <wucong.lyb@alibaba-inc.com>
Date: 星期五, 01 九月 2023 10:08:27 +0800
Subject: [PATCH] Update readme_cn.md

---
 funasr/layers/global_mvn.py |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/funasr/layers/global_mvn.py b/funasr/layers/global_mvn.py
index 11c459d..b94e9ca 100644
--- a/funasr/layers/global_mvn.py
+++ b/funasr/layers/global_mvn.py
@@ -4,15 +4,15 @@
 
 import numpy as np
 import torch
-from typeguard import check_argument_types
 
 from funasr.modules.nets_utils import make_pad_mask
+from funasr.layers.abs_normalize import AbsNormalize
+from funasr.layers.inversible_interface import InversibleInterface
 
-class GlobalMVN(torch.nn.Module):
+
+class GlobalMVN(AbsNormalize, InversibleInterface):
     """Apply global mean and variance normalization
-
     TODO(kamo): Make this class portable somehow
-
     Args:
         stats_file: npy file
         norm_means: Apply mean normalization
@@ -27,7 +27,6 @@
         norm_vars: bool = True,
         eps: float = 1.0e-20,
     ):
-        assert check_argument_types()
         super().__init__()
         self.norm_means = norm_means
         self.norm_vars = norm_vars
@@ -63,7 +62,6 @@
         self, x: torch.Tensor, ilens: torch.Tensor = None
     ) -> Tuple[torch.Tensor, torch.Tensor]:
         """Forward function
-
         Args:
             x: (B, L, ...)
             ilens: (B,)
@@ -115,4 +113,4 @@
         if norm_means:
             x += self.mean
             x.masked_fill_(make_pad_mask(ilens, x, 1), 0.0)
-        return x, ilens
+        return x, ilens
\ No newline at end of file

--
Gitblit v1.9.1