original_docstring: 
          We will be using the Keras conv2d method, and essentially we have
          to do here is multiply the mask with the input X, before we apply the
          convolutions. For the mask itself, we apply convolutions with all weights
          set to 1.
          Subsequently, we clip mask values to between 0 and 1
          
docstring: We will be using the Keras conv2d method, and essentially we have
  to do here is multiply the mask with the input X, before we apply the
  convolutions. For the mask itself, we apply convolutions with all weights
  set to 1.
  Subsequently, we clip mask values to between 0 and 1
docstring_tokens: We will be using the Keras conv2d method and essentially we have to do here is multiply the mask with the input X before we apply the convolutions . For the mask itself we apply convolutions with all weights set to 1 . Subsequently we clip mask values to between 0 and 1
code: def call(self, inputs, mask=None):
          '''
          We will be using the Keras conv2d method, and essentially we have
          to do here is multiply the mask with the input X, before we apply the
          convolutions. For the mask itself, we apply convolutions with all weights
          set to 1.
          Subsequently, we clip mask values to between 0 and 1
          ''' 
          # Both image and mask must be supplied
          if type(inputs) is not list or len(inputs) != 2:
              raise Exception('PartialConvolution2D must be called on a list of two tensors [img, mask]. Instead got: ' + str(inputs))
  
          # Padding done explicitly so that padding becomes part of the masked partial convolution
          images = K.spatial_2d_padding(inputs[0], self.pconv_padding, self.data_format)
          masks = K.spatial_2d_padding(inputs[1], self.pconv_padding, self.data_format)
  
          # Apply convolutions to mask
          mask_output = K.conv2d(
              masks, self.kernel_mask, 
              strides=self.strides,
              padding='valid',
              data_format=self.data_format,
              dilation_rate=self.dilation_rate
          )
  
          # Apply convolutions to image
          img_output = K.conv2d(
              (images*masks), self.kernel, 
              strides=self.strides,
              padding='valid',
              data_format=self.data_format,
              dilation_rate=self.dilation_rate
          )
  
          # Calculate the mask ratio on each pixel in the output mask
          mask_ratio = self.window_size / (mask_output + 1e-8)
  
          # Clip output to be between 0 and 1
          mask_output = K.clip(mask_output, 0, 1)
  
          # Remove ratio values where there are holes
          mask_ratio = mask_ratio * mask_output
  
          # Normalize iamge output
          img_output = img_output * mask_ratio
  
          # Add bias
          if self.use_bias:
              # pdb.set_trace()
              # img_output = K.bias_add(
              #     img_output,
              #     self.bias,
              #     data_format=self.data_format)
              img_output = img_output + K.tile(self.bias,[1,1,1,self.tileNum])
  
          # Apply activations on the image
          if self.activation is not None:
              img_output = self.activation(img_output)
              
          return [img_output, mask_output]
code_tokens: def call ( self , inputs , mask = None ) : if type ( inputs ) is not list or len ( inputs ) != 2 : raise Exception ( 'PartialConvolution2D must be called on a list of two tensors [img, mask]. Instead got: ' + str ( inputs ) ) images = K . spatial_2d_padding ( inputs [ 0 ] , self . pconv_padding , self . data_format ) masks = K . spatial_2d_padding ( inputs [ 1 ] , self . pconv_padding , self . data_format ) mask_output = K . conv2d ( masks , self . kernel_mask , strides = self . strides , padding = 'valid' , data_format = self . data_format , dilation_rate = self . dilation_rate ) img_output = K . conv2d ( ( images * masks ) , self . kernel , strides = self . strides , padding = 'valid' , data_format = self . data_format , dilation_rate = self . dilation_rate ) mask_ratio = self . window_size / ( mask_output + 1e-8 ) mask_output = K . clip ( mask_output , 0 , 1 ) mask_ratio = mask_ratio * mask_output img_output = img_output * mask_ratio if self . use_bias : img_output = img_output + K . tile ( self . bias , [ 1 , 1 , 1 , self . tileNum ] ) if self . activation is not None : img_output = self . activation ( img_output ) return [ img_output , mask_output ]
short_docstring: We will be using the Keras conv2d method, and essentially we have
  to do here is multiply the mask with the input X, before we apply the
  convolutions.
short_docstring_tokens: We will be using the Keras conv2d method and essentially we have to do here is multiply the mask with the input X before we apply the convolutions .
comment: '''
          We will be using the Keras conv2d method, and essentially we have
          to do here is multiply the mask with the input X, before we apply the
          convolutions. For the mask itself, we apply convolutions with all weights
          set to 1.
          Subsequently, we clip mask values to between 0 and 1
          '''$SEP$# Both image and mask must be supplied$SEP$# Padding done explicitly so that padding becomes part of the masked partial convolution$SEP$# Apply convolutions to mask$SEP$# Apply convolutions to image$SEP$# Calculate the mask ratio on each pixel in the output mask$SEP$# Clip output to be between 0 and 1$SEP$# Remove ratio values where there are holes$SEP$# Normalize iamge output$SEP$# Add bias$SEP$# pdb.set_trace()$SEP$# img_output = K.bias_add($SEP$#     img_output,$SEP$#     self.bias,$SEP$#     data_format=self.data_format)$SEP$# Apply activations on the image