class_docstr: Tests SignalConv against scipy.signal.
class_docstr_tok: ["Tests","SignalConv","against","scipy.signal","."]
docstr: Convolve/correlate using SciPy.
code: def scipy_convolve_valid(
      self,
      corr,
      inputs,
      kernel,
      strides_down,
      strides_up,
      extra_pad_end,
      channel_separable,
  ):
      """Convolve/correlate using SciPy."""
      convolve = (
          scipy.signal.correlate if corr else scipy.signal.convolve
      )
      slices = tuple(slice(None, None, s) for s in strides_down)
  
      # Upsample input.
      if not all(s == 1 for s in strides_up):
          inputs = self.numpy_upsample(
              inputs, strides_up, extra_pad_end
          )
  
      channels_out = kernel.shape[-1]
      if channel_separable:
          channels_out *= inputs.shape[1]
  
      # Get size of output and initialize with zeros.
      outputs = convolve(inputs[0, 0], kernel[..., 0, 0], mode="valid")
      outputs = outputs[slices]
      outputs = np.zeros(
          (1, channels_out) + outputs.shape, dtype=np.float32
      )
  
      # Iterate over channels, downsampling outputs as we go.
      for batch in range(inputs.shape[0]):
          for filter_out in range(kernel.shape[-1]):
              for channel_in in range(inputs.shape[1]):
                  if channel_separable:
                      channel_out = (
                          channel_in * kernel.shape[-1] + filter_out
                      )
                  else:
                      channel_out = filter_out
                  outputs[batch, channel_out] += convolve(
                      inputs[batch, channel_in],
                      kernel[..., channel_in, filter_out],
                      mode="valid",
                  )[slices]
  
      return outputs
  
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 2 for calling the ConvolutionsTest obj's underlying member method code with example usage: obj.scipy_convolve_valid(corr, inputs, kernel, strides_down, strides_up, extra_pad_end, channel_separable) and returns: outputs