Merge branch 'master' into tf2
This commit is contained in:
@@ -138,11 +138,7 @@ def swish(x):
|
|||||||
ACT2FN = {"gelu": gelu, "relu": torch.nn.functional.relu, "swish": swish, "gelu_new": gelu_new}
|
ACT2FN = {"gelu": gelu, "relu": torch.nn.functional.relu, "swish": swish, "gelu_new": gelu_new}
|
||||||
|
|
||||||
|
|
||||||
try:
|
BertLayerNorm = torch.nn.LayerNorm
|
||||||
from apex.normalization.fused_layer_norm import FusedLayerNorm as BertLayerNorm
|
|
||||||
except (ImportError, AttributeError) as e:
|
|
||||||
logger.info("Better speed can be achieved with apex installed from https://www.github.com/nvidia/apex .")
|
|
||||||
BertLayerNorm = torch.nn.LayerNorm
|
|
||||||
|
|
||||||
class BertEmbeddings(nn.Module):
|
class BertEmbeddings(nn.Module):
|
||||||
"""Construct the embeddings from word, position and token_type embeddings.
|
"""Construct the embeddings from word, position and token_type embeddings.
|
||||||
|
|||||||
Reference in New Issue
Block a user