code: def test_pytorch_seq_len(self):
      # 1. 随机测试
      seq_len = oneflow.randint(1, 10, size=(10,))
      max_len = seq_len.max()
      mask = seq_len_to_mask(seq_len)
      assert max_len == mask.shape[1]
      self.evaluate_mask_seq_len(seq_len.tolist(), mask)
  
      # 2. 异常检测
      seq_len = oneflow.randn(3, 4)
      with pytest.raises(AssertionError):
          mask = seq_len_to_mask(seq_len)
  
      # 3. pad到指定长度
      seq_len = oneflow.randint(1, 10, size=(10,))
      mask = seq_len_to_mask(seq_len, 100)
      assert 100 == mask.size(1)
  
file_path: fastNLP/tests/core/utils/test_seq_len_to_mask.py
imports: import pytest
  import numpy
  from fastNLP.core.utils.seq_len_to_mask import seq_len_to_mask
  from fastNLP.envs.imports import _NEED_IMPORT_JITTOR, _NEED_IMPORT_PADDLE, _NEED_IMPORT_TORCH, _NEED_IMPORT_ONEFLOW
label_desc: Use image node_id 6 for calling the TestSeqLenToMask obj's underlying member method code with example usage: obj.test_pytorch_seq_len() without return types