Browse Source

add codes testing utils

tags/v0.1.0
xuyige 6 years ago
parent
commit
7a54a20908
1 changed files with 18 additions and 0 deletions
  1. +18
    -0
      test/modules/test_utils.py

+ 18
- 0
test/modules/test_utils.py View File

@@ -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)


Loading…
Cancel
Save