You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

test_utils.py 350 B

123456789101112131415161718
  1. import torch
  2. import numpy as np
  3. import unittest
  4. import fastNLP.modules.utils as utils
  5. class TestUtils(unittest.TestCase):
  6. def test_case_1(self):
  7. a = torch.tensor([
  8. [1, 2, 3, 4, 5], [2, 3, 4, 5, 6]
  9. ])
  10. utils.orthogonal(a)
  11. def test_case_2(self):
  12. a = np.random.rand(100, 100)
  13. utils.mst(a)

一款轻量级的自然语言处理(NLP)工具包,目标是减少用户项目中的工程型代码,例如数据处理循环、训练循环、多卡运行等