fastnlp / fastNLP

fastNLP: A Modularized and Extensible NLP Framework. Currently still in incubation.
https://gitee.com/fastnlp/fastNLP
Apache License 2.0
3.07k stars 447 forks source link

[bugfix]Update transformer.py #217

Closed ZikaiGuo closed 5 years ago

ZikaiGuo commented 5 years ago

Description:修复transformer.py中的bug

Main reason: 36行的forward函数中,seq_mask有可能是None,与向量相乘前应做检查,避免报错。

codecov-io commented 5 years ago

Codecov Report

Merging #217 into dev0.5.0 will decrease coverage by <.01%. The diff coverage is 50%.

Impacted file tree graph

@@             Coverage Diff              @@
##           dev0.5.0     #217      +/-   ##
============================================
- Coverage     66.72%   66.72%   -0.01%     
============================================
  Files            78       78              
  Lines          9290     9292       +2     
============================================
+ Hits           6199     6200       +1     
- Misses         3091     3092       +1
Impacted Files Coverage Δ
fastNLP/modules/encoder/transformer.py 94.59% <50%> (-2.55%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 8c8e22c...1caa83d. Read the comment docs.