add fourth chapter

This commit is contained in:
skindhu 2024-11-05 17:18:21 +08:00
parent 712db78569
commit 3e3c9d6634
1 changed files with 4 additions and 4 deletions

View File

@ -108,17 +108,17 @@ class DummyGPTModel(nn.Module):
class DummyTransformerBlock(nn.Module): #C class DummyTransformerBlock(nn.Module): #C
def __init__(self, cfg): def __init__(self, cfg):
super().__init__() super().__init__()
def forward(self, x): #D def forward(self, x): #D
return x return x
class DummyLayerNorm(nn.Module): #E class DummyLayerNorm(nn.Module): #E
def __init__(self, normalized_shape, eps=1e-5): #F def __init__(self, normalized_shape, eps=1e-5): #F
super().__init__() super().__init__()
def forward(self, x): def forward(self, x):
return x return x
#A 为 TransformerBlock 设置占位符 #A 为 TransformerBlock 设置占位符