code: public static void validateConvolutionModePadding(ConvolutionMode mode, int padding) {
          if (mode == ConvolutionMode.Same) {
              boolean nullPadding = true;
              if (padding != 0) nullPadding = false;
              if (!nullPadding)
                  throw new IllegalArgumentException("Padding cannot be used when using the `same' convolution mode");
  
          }
      }
docs: Check that the convolution mode is consistent with the padding specification