Merge pull request #963 from guotong1988/patch-2

Update modeling_bert.py
This commit is contained in:
Thomas Wolf
2019-08-07 10:09:04 +02:00
committed by GitHub

View File

@@ -222,7 +222,7 @@ class BertConfig(PretrainedConfig):
try: try:
from apex.normalization.fused_layer_norm import FusedLayerNorm as BertLayerNorm from apex.normalization.fused_layer_norm import FusedLayerNorm as BertLayerNorm
except ImportError: except (ImportError, AttributeError) as e:
logger.info("Better speed can be achieved with apex installed from https://www.github.com/nvidia/apex .") logger.info("Better speed can be achieved with apex installed from https://www.github.com/nvidia/apex .")
class BertLayerNorm(nn.Module): class BertLayerNorm(nn.Module):
def __init__(self, hidden_size, eps=1e-12): def __init__(self, hidden_size, eps=1e-12):