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_卷积基本操作
2021-11-09
Next
PyTorch_7_DataLoader的使用
2021-11-07