title: Errors rewriting a Tensorflow model in Pytorch
body: <p>I have model written in Tensorflow and I would like to convert it to Pytorch.
  However I am having a lot of problems in converting because I am getting confused between functions, for instance, for Tensorflow BatchNormalization should I use BatchNorm1d or BatchNorm2?</p>
  <p>The code in Tensorflow is this:</p>
  <pre><code>    input = Input(shape=(216, 1025, 1))
      norm_inp1 = BatchNormalization()(input)
      img_1 = Convolution2D(16, kernel_size=(3, 7), activation=activations.relu)(norm_inp1)
      img_1 = Convolution2D(16, kernel_size=(3, 7), activation=activations.relu)(img_1)
      img_1 = MaxPooling2D(pool_size=(3, 7))(img_1)
      img_1 = Dropout(rate=0.1)(img_1)
      img_1 = Convolution2D(32, kernel_size=3, activation=activations.relu)(img_1)
      img_1 = Convolution2D(32, kernel_size=3, activation=activations.relu)(img_1)
      img_1 = MaxPooling2D(pool_size=(3, 3))(img_1)
      img_1 = Dropout(rate=0.1)(img_1)
      img_1 = Convolution2D(128, kernel_size=3, activation=activations.relu)(img_1)
      img_1 = GlobalMaxPool2D()(img_1)
      img_1 = Dropout(rate=0.1)(img_1)
  </code></pre>
  <p>I have created a class that extends torch.nn.Module in which I apply this sequential:</p>
  <pre><code>features = torch.nn.Sequential(
              torch.nn.BatchNorm2d(1025),
              torch.nn.Conv1d(16, 1, kernel_size=(3, 7)),
              torch.nn.ReLU(inplace=True),
              torch.nn.Conv2d(16, 16, kernel_size=(3, 7)),
              torch.nn.ReLU(inplace=True),
              torch.nn.MaxPool2d(kernel_size=(3,7)),
              torch.nn.Dropout2d(0.1),
              torch.nn.Conv2d(16, 32, kernel_size=3),
              torch.nn.ReLU(inplace=True),
              torch.nn.Conv2d(32, 32, kernel_size=3),
              torch.nn.ReLU(inplace=True),
              torch.nn.MaxPool2d(kernel_size=(3,3)),
              torch.nn.Dropout2d(0.1),
              torch.nn.Conv2d(32, 128, kernel_size=3),
              torch.nn.ReLU(inplace=True),
              torch.nn.MaxPool2d(kernel_size=(20,44)),
              torch.nn.Dropout2d(0.1)
          )
  </code></pre>
  <p>Could someone help me to understand the errors in the second one? I have perfectly understood the code in Tensorflow.
  For complete network schema you can consult <a href="https://github.com/Vishwa07/IndoorSoundClassificaition/blob/master/ProjectReport.pdf" rel="nofollow noreferrer">this link</a></p>