original_docstring: 
          Helper function to create the elemental blocks for the decoder. Creates a gated convnet decoder.
          
docstring: Helper function to create the elemental blocks for the decoder. Creates a gated convnet decoder.
docstring_tokens: Helper function to create the elemental blocks for the decoder . Creates a gated convnet decoder .
code: def create_decoder(self):
          """
          Helper function to create the elemental blocks for the decoder. Creates a gated convnet decoder.
          """
  
          num_classes = 256
  
          if self.input_type == 'binary':
              p_x_nn = nn.Sequential(
                  GatedConvTranspose2d(self.z_size, 64, self.last_kernel_size, 1, 0),
                  GatedConvTranspose2d(64, 64, 5, 1, 2),
                  GatedConvTranspose2d(64, 32, 5, 2, 2, 1),
                  GatedConvTranspose2d(32, 32, 5, 1, 2),
                  GatedConvTranspose2d(32, 32, 5, 2, 2, 1),
                  GatedConvTranspose2d(32, 32, 5, 1, 2)
              )
  
              p_x_mean = nn.Sequential(
                  nn.Conv2d(32, self.input_size[0], 1, 1, 0),
                  nn.Sigmoid()
              )
              return p_x_nn, p_x_mean
  
          elif self.input_type == 'multinomial':
              act = None
              p_x_nn = nn.Sequential(
                  GatedConvTranspose2d(self.z_size, 64, self.last_kernel_size, 1, 0, activation=act),
                  GatedConvTranspose2d(64, 64, 5, 1, 2, activation=act),
                  GatedConvTranspose2d(64, 32, 5, 2, 2, 1, activation=act),
                  GatedConvTranspose2d(32, 32, 5, 1, 2, activation=act),
                  GatedConvTranspose2d(32, 32, 5, 2, 2, 1, activation=act),
                  GatedConvTranspose2d(32, 32, 5, 1, 2, activation=act)
              )
  
              p_x_mean = nn.Sequential(
                  nn.Conv2d(32, 256, 5, 1, 2),
                  nn.Conv2d(256, self.input_size[0] * num_classes, 1, 1, 0),
                  # output shape: batch_size, num_channels * num_classes, pixel_width, pixel_height
              )
  
              return p_x_nn, p_x_mean
  
          else:
              raise ValueError('invalid input type!!')
code_tokens: def create_decoder ( self ) : num_classes = 256 if self . input_type == 'binary' : p_x_nn = nn . Sequential ( GatedConvTranspose2d ( self . z_size , 64 , self . last_kernel_size , 1 , 0 ) , GatedConvTranspose2d ( 64 , 64 , 5 , 1 , 2 ) , GatedConvTranspose2d ( 64 , 32 , 5 , 2 , 2 , 1 ) , GatedConvTranspose2d ( 32 , 32 , 5 , 1 , 2 ) , GatedConvTranspose2d ( 32 , 32 , 5 , 2 , 2 , 1 ) , GatedConvTranspose2d ( 32 , 32 , 5 , 1 , 2 ) ) p_x_mean = nn . Sequential ( nn . Conv2d ( 32 , self . input_size [ 0 ] , 1 , 1 , 0 ) , nn . Sigmoid ( ) ) return p_x_nn , p_x_mean elif self . input_type == 'multinomial' : act = None p_x_nn = nn . Sequential ( GatedConvTranspose2d ( self . z_size , 64 , self . last_kernel_size , 1 , 0 , activation = act ) , GatedConvTranspose2d ( 64 , 64 , 5 , 1 , 2 , activation = act ) , GatedConvTranspose2d ( 64 , 32 , 5 , 2 , 2 , 1 , activation = act ) , GatedConvTranspose2d ( 32 , 32 , 5 , 1 , 2 , activation = act ) , GatedConvTranspose2d ( 32 , 32 , 5 , 2 , 2 , 1 , activation = act ) , GatedConvTranspose2d ( 32 , 32 , 5 , 1 , 2 , activation = act ) ) p_x_mean = nn . Sequential ( nn . Conv2d ( 32 , 256 , 5 , 1 , 2 ) , nn . Conv2d ( 256 , self . input_size [ 0 ] * num_classes , 1 , 1 , 0 ) , ) return p_x_nn , p_x_mean else : raise ValueError ( 'invalid input type!!' )
short_docstring: Helper function to create the elemental blocks for the decoder.
short_docstring_tokens: Helper function to create the elemental blocks for the decoder .
comment: """
          Helper function to create the elemental blocks for the decoder. Creates a gated convnet decoder.
          """$SEP$# output shape: batch_size, num_channels * num_classes, pixel_width, pixel_height