title: How do I write a PyTorch sequential model?
body: <p>How do I write a sequential model in PyTorch, just like what we can do with Keras? I tried:</p>
  <pre><code>import torch
  import torch.nn as nn
  
  net = nn.Sequential()
  net.add(nn.Linear(3, 4))
  net.add(nn.Sigmoid())
  net.add(nn.Linear(4, 1))
  net.add(nn.Sigmoid())
  net.float()
  </code></pre>
  <p>But I get the error:</p>
  <blockquote>
  <p>AttributeError: 'Sequential' object has no attribute 'add'</p>
  </blockquote>