From 7a54a20908c1a6e98039b4f29f58afd2488ee9bb Mon Sep 17 00:00:00 2001 From: xuyige Date: Tue, 28 Aug 2018 17:18:36 +0800 Subject: [PATCH] add codes testing utils --- test/modules/test_utils.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/modules/test_utils.py diff --git a/test/modules/test_utils.py b/test/modules/test_utils.py new file mode 100644 index 00000000..1cfc6aa1 --- /dev/null +++ b/test/modules/test_utils.py @@ -0,0 +1,18 @@ + +import torch +import numpy as np +import unittest + +import fastNLP.modules.utils as utils + +class TestUtils(unittest.TestCase): + def test_case_1(self): + a = torch.tensor([ + [1, 2, 3, 4, 5], [2, 3, 4, 5, 6] + ]) + utils.orthogonal(a) + + def test_case_2(self): + a = np.random.rand(100, 100) + utils.mst(a) +