关于pytorch:PyTorchLinearfc

35次阅读

共计 228 个字符,预计需要花费 1 分钟才能阅读完成。

全连贯层


代码

import torch
import torch.nn as nn

fc = nn.Linear(512, 10)
input = torch.randn(1, 512, 1, 1)
output = input.view(input.size(0), -1)
output = fc(output)
print(output.size())

torch.Size([1, 10])

援用

<1>

torch=1.7.1+cu101
torchvision=0.8.2
torchaudio=0.7.2

正文完
 0