浏览代码

!8725 add definition of scale for GPT

From: @alouhahahahaha
Reviewed-by: @guoqi1024,@c_34
Signed-off-by: @guoqi1024
tags/v1.1.0
mindspore-ci-bot Gitee 5 年前
父节点
当前提交
8da2a59764
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. +1
    -0
      model_zoo/official/nlp/gpt/src/gpt.py

+ 1
- 0
model_zoo/official/nlp/gpt/src/gpt.py 查看文件

@@ -361,6 +361,7 @@ class Block(nn.Cell):
"""
def __init__(self, config, layer_idx):
super(Block, self).__init__()
scale = 1.0
self.layernorm1 = LayerNorm((config.embedding_size,)).to_float(config.compute_dtype)
self.attention = Attention(config, scale, layer_idx)
self.layernorm2 = LayerNorm((config.embedding_size,)).to_float(config.compute_dtype)


正在加载...
取消
保存