code: def test_reshape_free_static_axis():
      x = C.input_variable((C.FreeDimension, 2, 3))
      x_reshaped = C.reshape(x, (-1), 0, 2)
      assert x_reshaped.shape == (C.FreeDimension, 3)
      x_data = np.arange(12).reshape(2, 2, 3)
      result = x_reshaped.eval({x: x_data})
      assert np.array_equal(result[0], x_data.reshape(4, 3))
  
      x_data = np.arange(18).reshape(3, 2, 3)
      result = x_reshaped.eval({x: x_data})
      assert np.array_equal(result[0], x_data.reshape(6, 3))
  
      x_reshaped = C.reshape(x, (-1), 1, 3)
      assert x_reshaped.shape == (C.FreeDimension, 6)
      x_data = np.arange(12).reshape(2, 2, 3)
      result = x_reshaped.eval({x: x_data})
      assert np.array_equal(result[0], x_data.reshape(2, 6))
  
      x_reshaped = C.reshape(x, (4), 0, 2)
      assert x_reshaped.shape == (4, 3)
      x_data = np.arange(12).reshape(2, 2, 3)
      result = x_reshaped.eval({x: x_data})
      assert np.array_equal(result[0], x_data.reshape(4, 3))
  
      x_data = np.arange(6).reshape(1, 2, 3)
      with pytest.raises(ValueError):
          result = x_reshaped.eval({x: x_data})
  
imports: import numpy
  import pytest
  import cntk
  from cntk.ops.functions import Function, UserFunction
  from .ops_test_utils import AA
label_desc: Use image node_id 3 for calling a global function with example usage: test_reshape_free_static_axis() without return types