code: def test_conv_pooling_free_static_and_dynamic_axes(
      warmup_input_size,
      free_dimension_increment,
      filter_size,
      num_output_channels,
      batch_size_range,
      device_id,
      precision,
  ):
      dt = PRECISION_TO_TYPE[precision]
      dev = cntk_device(device_id)
  
      np.random.seed(0)
  
      conv_size = tuple(
          [num_output_channels, warmup_input_size[0]] + filter_size
      )
      total_size = np.prod(conv_size)
      y = np.arange(total_size, dtype=dt)
      conv_map = constant(value=y.reshape(conv_size), device=dev)
  
      warmup_batchsize = np.random.randint(
          batch_size_range[0], batch_size_range[1]
      )
      ref_batchsize = np.random.randint(
          batch_size_range[0], batch_size_range[1]
      )
  
      reference_input_size = tuple(
          warmup_input_size[: -len(free_dimension_increment)]
          + [
              x + y
              for x, y in zip(
                  warmup_input_size[-len(free_dimension_increment) :],
                  free_dimension_increment,
              )
          ]
      )
  
      a_ref = C.sequence.input_variable(
          shape=reference_input_size,
          dtype=dt,
          needs_gradient=False,
          sequence_axis=C.Axis.new_unique_dynamic_axis("c"),
      )
      a_test = C.sequence.input_variable(
          shape=tuple(
              warmup_input_size[: -len(free_dimension_increment)]
              + [C.FreeDimension] * len(free_dimension_increment)
          ),
          dtype=dt,
          needs_gradient=False,
          sequence_axis=C.Axis.new_unique_dynamic_axis("c"),
      )
  
      from cntk import convolution, pooling, unpooling
  
      def pooling_unpooling(x):
          y = pooling(
              x, C.AVG_POOLING, (2, 2), (2, 2), auto_padding=[True]
          )
          return unpooling(
              y, x, C.MAX_UNPOOLING, (2, 2), (2, 2), auto_padding=[True]
          )
  
      conv_ops = [
          [
              convolution(
                  conv_map,
                  a_ref,
                  auto_padding=[False] + [True] * len(filter_size),
              ),
              convolution(
                  conv_map,
                  a_test,
                  auto_padding=[False] + [True] * len(filter_size),
              ),
          ],
          [pooling_unpooling(a_ref), pooling_unpooling(a_test)],
      ]
  
      for op_pair in conv_ops:
          conv_op_without_free_dim, conv_op_with_free_dim = op_pair
          input_img_ref = np.random.random(
              (ref_batchsize,) + reference_input_size
          ).astype(dt)
          output_ref = conv_op_without_free_dim.eval(
              {a_ref: input_img_ref}, device=dev
          )
  
          input_img_warmup = np.random.random(
              (warmup_batchsize,) + tuple(warmup_input_size)
          ).astype(dt)
          _ = conv_op_with_free_dim.eval(
              {a_test: input_img_warmup}, device=dev
          )
  
          output_test = conv_op_with_free_dim.eval(
              {a_test: input_img_ref}, device=dev
          )
  
          assert np.allclose(output_test, output_ref, atol=1e-4)
  
imports: from __future__ import division
  import numpy
  import pytest
  import cntk
  from .ops_test_utils import unittest_helper, _test_unary_op, AA, precision, PRECISION_TO_TYPE, constant, cntk_device
  from cntk.ops import AVG_POOLING, MAX_POOLING, MAX_UNPOOLING
  from cntk.internal import sanitize_dtype_cntk
  from cntk.cntk_py import should_force_deterministic_algorithms
label_desc: Use image node_id 20 for calling a global function with example usage: test_conv_pooling_free_static_and_dynamic_axes(warmup_input_size, free_dimension_increment, filter_size, num_output_channels, batch_size_range, device_id, precision) and returns: unpooling