code: def _fold_helper(draw, dim=2):
      stride, padding, dilation, kernel_size = draw(
          _fold_unfold_helper(dim)
      )
      strides = [stride] * dim if isinstance(stride, int) else stride
      paddings = (
          [padding] * dim if isinstance(padding, int) else padding
      )
      dilations = (
          [dilation] * dim if isinstance(dilation, int) else dilation
      )
      kernel_sizes = (
          [kernel_size] * dim
          if isinstance(kernel_size, int)
          else kernel_size
      )
      output_shape = ()
      for i in range(dim):
          min_dim = kernel_sizes[i] + (kernel_sizes[i] - 1) * (
              dilations[i] - 1
          )
          output_shape = output_shape + (
              draw(st.integers(min_dim, 15)),
          )
      batch_size = draw(st.integers(1, 5))
      n_channels = draw(st.integers(1, 3))
      x_shape = [
          (
              output_shape[i]
              + 2 * paddings[i]
              - dilations[i] * (kernel_sizes[i] - 1)
              - 1
          )
          // strides[i]
          + 1
          for i in range(2)
      ]
      x_shape = (
          batch_size,
          n_channels * math.prod(kernel_sizes),
          math.prod(x_shape),
      )
      dtype, [vals] = draw(
          helpers.dtype_and_values(
              available_dtypes=helpers.get_dtypes("float"),
              shape=x_shape,
              min_value=0.0,
              max_value=1.0,
          )
      )
      if vals.shape[0] == 1:  # un-batched inputs are also supported
          vals = draw(st.sampled_from([vals, vals[0]]))
      return (
          dtype,
          vals,
          kernel_size,
          output_shape,
          dilation,
          stride,
          padding,
      )
  
file_path: ivy/ivy_tests/test_ivy/test_frontends/test_torch/test_nn/test_functional/test_convolution_functions.py
imports: import math
  from hypothesis import strategies, assume
  import ivy_tests.test_ivy.helpers
  from ivy_tests.test_ivy.helpers import handle_frontend_test
  from ivy_tests.test_ivy.test_functional.test_nn.test_layers import _assume_tf_dilation_gt_1
label_desc: Use image node_id 1 for calling a global function with example usage: _fold_helper(draw, dim) and returns: dtype,  vals,  kernel_size,  output_shape,  dilation,  stride,  padding