class_docstr: Tests SignalConv against scipy.signal.
class_docstr_tok: ["Tests","SignalConv","against","scipy.signal","."]
code: def run_same(
      self,
      batch,
      input_support,
      channels,
      filters,
      kernel_support,
      corr,
      strides_down,
      strides_up,
      padding,
      extra_pad_end,
      channel_separable,
      data_format,
      activation,
      use_bias,
  ):
      assert channels == filters == 1
  
      # Create input array.
      input_shape = (batch, 1) + input_support
      inputs = np.arange(np.prod(input_shape))
      inputs = inputs.reshape(input_shape).astype(np.float32)
      if data_format != "channels_first":
          tf_inputs = tf.constant(np.moveaxis(inputs, 1, -1))
      else:
          tf_inputs = tf.constant(inputs)
  
      # Create kernel array. This is an identity kernel, so the outputs should
      # be equal to the inputs except for up- and downsampling.
      tf_kernel = initializers.IdentityInitializer()(
          shape=kernel_support + (1, filters), dtype=tf.float32
      )
  
      # Run SignalConv* layer.
      layer_class = {
          3: signal_conv.SignalConv1D,
          4: signal_conv.SignalConv2D,
          5: signal_conv.SignalConv3D,
      }[inputs.ndim]
      layer = layer_class(
          1,
          kernel_support,
          corr=corr,
          strides_down=strides_down,
          strides_up=strides_up,
          padding=padding,
          extra_pad_end=extra_pad_end,
          channel_separable=channel_separable,
          data_format=data_format,
          activation=activation,
          use_bias=use_bias,
          kernel_parameter=tf_kernel,
      )
      outputs = layer(tf_inputs).numpy()
  
      # Check that SignalConv* computes the correct output size.
      predicted_shape = layer.compute_output_shape(tf_inputs.shape)
      self.assertEqual(outputs.shape, tuple(predicted_shape))
  
      # If not using channels_first, convert back to it to compare to input.
      if data_format != "channels_first":
          outputs = np.moveaxis(outputs, -1, 1)
  
      # Upsample and then downsample inputs.
      expected = inputs
      if not all(s == 1 for s in strides_up):
          expected = self.numpy_upsample(
              expected, strides_up, extra_pad_end
          )
      slices = (slice(None), slice(None))
      slices += tuple(slice(None, None, s) for s in strides_down)
      expected = expected[slices]
  
      self.assertAllClose(expected, outputs, rtol=0, atol=1e-3)
  
imports: import os
  from absl.testing import parameterized
  import numpy
  import scipy.signal
  import tensorflow
  from tensorflow_compression.python.layers import initializers
  from tensorflow_compression.python.layers import parameters
  from tensorflow_compression.python.layers import signal_conv
label_desc: Use image node_id 4 for calling the ConvolutionsTest obj's underlying member method code with example usage: obj.run_same(batch, input_support, channels, filters, kernel_support, corr, strides_down, strides_up, padding, extra_pad_end, channel_separable, data_format, activation, use_bias) without return types