title: How to know the input shape of a pytorch model?
body: <p>I have a list of 100 matrix with the shape <code>(20,48)</code> and I want to pass this matrix in pytorch. </p>
  
  <p>This is the sample code</p>
  
  <pre><code>import torch.nn.functional as F
  import torch.nn as nn
  import torch
  
  sample = torch.randn(100,20,48)
  
  class Net(nn.Module):
      def __init__(self):
          super().__init__()
          self.conv = nn.Conv1d(20, 48, kernel_size=2)
      def forward(self, x):
          return self.conv(x)
  
  net = Net()
  
  for i in net.state_dict().keys():
      print(i)
  
  for i in list(net.parameters()):
      print(i.shape)
  
  #output
  
  conv.weight
  conv.bias
  
  torch.Size([48, 20, 2])
  torch.Size([48])
  </code></pre>
  
  <p>How to check that my the model takes an input of particular shape? In my case how can I confirm if my model input conv layer takes a matrix of the size (bs,20,48)?</p>