class_docstr: Tests SignalConv against scipy.signal.
class_docstr_tok: ["Tests","SignalConv","against","scipy.signal","."]
code: def run_valid(
      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 padding == "valid"
  
      # Create input array.
      inputs = np.random.randint(
          32, size=(batch, channels) + input_support
      )
      inputs = inputs.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.
      kernel = np.random.randint(
          16, size=kernel_support + (channels, filters)
      )
      kernel = kernel.astype(np.float32)
      tf_kernel = tf.constant(kernel)
  
      # Run SignalConv* layer.
      layer_class = {
          3: signal_conv.SignalConv1D,
          4: signal_conv.SignalConv2D,
          5: signal_conv.SignalConv3D,
      }[inputs.ndim]
      layer = layer_class(
          filters,
          kernel_support,
          corr=corr,
          strides_down=strides_down,
          strides_up=strides_up,
          padding="valid",
          extra_pad_end=extra_pad_end,
          channel_separable=channel_separable,
          data_format=data_format,
          activation=activation,
          use_bias=use_bias,
          kernel_parameter=tf_kernel,
      )
      tf_outputs = layer(tf_inputs)
      outputs = tf_outputs.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 SciPy.
      if data_format != "channels_first":
          outputs = np.moveaxis(outputs, -1, 1)
  
      # Compute the equivalent result using SciPy and compare.
      expected = self.scipy_convolve_valid(
          corr,
          inputs,
          kernel,
          strides_down,
          strides_up,
          extra_pad_end,
          channel_separable,
      )
      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 3 for calling the ConvolutionsTest obj's underlying member method code with example usage: obj.run_valid(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