from typing import Any
import torch
from torch import nn
class TuDui(nn.Module):
def __init__(self):
super().__init__()
def forward(self, input):
output = input + 1
return output
tudui = TuDui()
x = torch.tensor(1.0)
output = tudui(x)
print(output)
Previous
![PyTorch_9_卷积基本操作](http://pic.huangruimin.tech/The_Wandering_Earth2_22.jpg)
2021-11-09
Next
![PyTorch_7_DataLoader的使用](http://pic.huangruimin.tech/The_Wandering_Earth2_69.jpg)
2021-11-07