From 97df53495c7db077f867dcf60b8210bc6045cf07 Mon Sep 17 00:00:00 2001 From: zooltd <43005566+zooltd@users.noreply.github.com> Date: Wed, 23 Oct 2019 20:48:39 +0800 Subject: [PATCH] fix typo (#52): Block -> Module --- docs/chapter04_DL_computation/4.1_model-construction.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/chapter04_DL_computation/4.1_model-construction.md b/docs/chapter04_DL_computation/4.1_model-construction.md index fc9a9da88..909f1a235 100644 --- a/docs/chapter04_DL_computation/4.1_model-construction.md +++ b/docs/chapter04_DL_computation/4.1_model-construction.md @@ -16,7 +16,7 @@ from torch import nn class MLP(nn.Module): # 声明带有模型参数的层,这里声明了两个全连接层 def __init__(self, **kwargs): - # 调用MLP父类Block的构造函数来进行必要的初始化。这样在构造实例时还可以指定其他函数 + # 调用MLP父类Module的构造函数来进行必要的初始化。这样在构造实例时还可以指定其他函数 # 参数,如“模型参数的访问、初始化和共享”一节将介绍的模型参数params super(MLP, self).__init__(**kwargs) self.hidden = nn.Linear(784, 256) # 隐藏层 @@ -75,7 +75,7 @@ class MySequential(nn.Module): for idx, module in enumerate(args): self.add_module(str(idx), module) def forward(self, input): - # self._modules返回一个 OrderedDict,保证会按照成员添加时的顺序遍历成 + # self._modules返回一个 OrderedDict,保证会按照成员添加时的顺序遍历成员 for module in self._modules.values(): input = module(input) return input