code: def test_op_reshape_free_dimension(device_id):
      dev = cntk_device(device_id)
      x = C.input_variable((C.FreeDimension, 2, 2))
  
      x_reshaped_1 = C.reshape(x, (-1,), 0, 2)
      data = [[[1, 2], [3, 4]]]
      result = x_reshaped_1.eval(
          {x: np.asarray(data, dtype=np.float32)}
      )
      assert np.array_equal(result[0], data[0])
      data = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]
      result = x_reshaped_1.eval(
          {x: np.asarray(data, dtype=np.float32)}
      )
      assert np.array_equal(result[0], np.reshape(data, (4, 2)))
  
      x_reshaped_2 = C.reshape(x, (-1,), 1, 3)
      data = [[[1, 2], [3, 4]]]
      result = x_reshaped_2.eval(
          {x: np.asarray(data, dtype=np.float32)}
      )
      assert np.array_equal(result[0], np.reshape(data, (1, 4)))
      data = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]
      result = x_reshaped_2.eval(
          {x: np.asarray(data, dtype=np.float32)}
      )
      assert np.array_equal(result[0], np.reshape(data, (2, 4)))
  
imports: from __future__ import division
  import numpy
  import cntk
  import pytest
  from .ops_test_utils import unittest_helper, _test_unary_op, _test_binary_op, AA, precision, PRECISION_TO_TYPE, cntk_device
  import cntk
  from cntk import Value
  from cntk.axis import Axis
  from cntk.internal import sanitize_dtype_cntk
  from ..None import constant
label_desc: Use image node_id 12 for calling a global function with example usage: test_op_reshape_free_dimension(device_id) without return types