message: Made helper function
diff: @@ -233,30 +233,14 @@ class Conv(Layer):
  # Check if output shapes are valid
  # They must not have 0 entries along any dimension
  + # Check if first or last dimension is number of channels
  if self._channels_first:
  for idx,dimension in enumerate(input_shape.as_list()[2:]):
  - output_dimension = conv_utils.conv_output_length(dimension,
  - self.kernel_size[idx],
  - self.padding,
  - self.strides[idx],
  - dilation = self.dilation_rate[idx])
  - if output_dimension is not None and output_dimension<=0:
  - raise ValueError('One of the dimensions in output tensor is less than or'
  - ' equal to zero. Please check the input shape. '
  - ' Recieved input: %s'%input_shape)
  + self._check_invalid_dimension(dimension, idx)
  else:
  for idx,dimension in enumerate(input_shape.as_list()[1:-1]):
  - output_dimension = conv_utils.conv_output_length(dimension,
  - self.kernel_size[idx],
  - self.padding,
  - self.strides[idx],
  - dilation = self.dilation_rate[idx])
  - if output_dimension is not None and output_dimension<=0:
  - raise ValueError('One of the dimensions in output tensor is less than or'
  - ' equal to zero. Please check the input shape. '
  - ' Recieved input: %s'%input_shape)
  -
  + self._check_invalid_dimension(dimension, idx)
  self._convolution_op = functools.partial(
  nn_ops.convolution_v2,
  @@ -330,6 +314,19 @@ class Conv(Layer):
  def _recreate_conv_op(self, inputs): # pylint: disable=unused-argument
  return False
  + def _check_invalid_dimension(self, dimension, idx):
  + """Checks if output has all positive dimensions"""
  + output_dimension = conv_utils.conv_output_length(dimension,
  + self.kernel_size[idx],
  + self.padding,
  + self.strides[idx],
  + dilation = self.dilation_rate[idx])
  + if output_dimension is not None and output_dimension<=0:
  + raise ValueError('One of the dimensions in output tensor is less than or'
  + ' equal to zero. Please check the input shape. '
  + ' Recieved input: %s'%input_shape)
  +
  +
  def get_config(self):
  config = {
  'filters':
  