We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
책에 코드가 아래처럼 되어 있는데 output = mod(output,src)가 아니고 output = mod(tgt,src)로 해도 어떻게 정상적으로 동작할 수 있나요?? (오타인거 같기도 해서 문의드립니다.)
import copy def get_clones(module, N): return nn.ModuleList([copy.deepcopy(module) for i in range(N)])
class TransformerDecoder(nn.Module): def init(self,decoder_layer,num_layers): super().init() self.layers = get_clones(decoder_layer, num_layers) self.num_layers = num_layers
def forward(self, tgt, src): output = tgt for mod in self.layers: output = mod(tgt,src) return output
The text was updated successfully, but these errors were encountered:
No branches or pull requests
책에 코드가 아래처럼 되어 있는데
output = mod(output,src)가 아니고 output = mod(tgt,src)로 해도 어떻게 정상적으로 동작할 수 있나요??
(오타인거 같기도 해서 문의드립니다.)
import copy
def get_clones(module, N):
return nn.ModuleList([copy.deepcopy(module) for i in range(N)])
class TransformerDecoder(nn.Module):
def init(self,decoder_layer,num_layers):
super().init()
self.layers = get_clones(decoder_layer, num_layers)
self.num_layers = num_layers
The text was updated successfully, but these errors were encountered: