torch optional sequential 源码
火炬-可选-顺序 from module import OptionalSequential class A(nn.Module): def forward(self,x): print(x) return x class B(nn.Module): def forward(self,x, mask): print(x, mask) return x class C(nn.Module): def __init__(self): super().__init__() self.layers = OptionalSequential( A(), B() ) def forward(self, x): self.layers(x, mask=3) return x model
文件列表
torch-optional-sequential-main.zip
(预估有个2文件)
torch-optional-sequential-main
README.md
461B
module.py
983B
暂无评论