Skip to content
Course Notes: Introduction to Deep Learning with PyTorch
add text here
import torch
import torch.nn as nn
input_tensor = torch.Tensor([[3, 4, 6, 2, 3, 6, 8, 9]])
# Implement a small neural network with exactly two linear layers
model = nn.Sequential(
nn.Linear(8,5),
nn.Linear(1,1),
)
output = model(input_tensor)
print(output)