[ 仅 API 调用方式不一致 ]torch.nn.Module.children
torch.nn.Module.children
torch.nn.Module.children()
转写示例
# PyTorch 写法
model = torch.nn.Sequential(net1, net2)
for layer in model.children():
print(layer)
# Paddle 写法
model = paddle.nn.Sequential(net1, net2)
for layer in model.children():
print(layer)