输出torch构建的模型结构
生活随笔
收集整理的這篇文章主要介紹了
输出torch构建的模型结构
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
import torch
from torch import nn
model = nn.Sequential(nn.Linear(2,2),nn.ReLU(),nn.Sequential(nn.Sigmoid(), nn.ReLU()))
print(model)
輸出
Sequential((0): Linear(in_features=2, out_features=2, bias=True)(1): ReLU()(2): Sequential((0): Sigmoid()(1): ReLU()) )總結
以上是生活随笔為你收集整理的输出torch构建的模型结构的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python-time.time()
- 下一篇: torch.unsqueeze()和to