code: def test_cloning():
      p = C.placeholder(shape=(1,), name="p")
      i = C.input_variable(shape=(1,), needs_gradient=True, name="i")
      res = p + i
  
      with pytest.raises(ValueError):
          res.clone(2)
  
      from ..functions import CloneMethod
  
      # Test freeze
      cloned = res.clone(CloneMethod.freeze)
      assert cloned.inputs[0].name == "p"
      assert cloned.inputs[0].uid != p.uid
      assert cloned.inputs[1].name == "i"
      assert cloned.inputs[1].uid != i.uid
  
      cloned = res.clone("freeze")
      assert cloned.inputs[0].name == "p"
      assert cloned.inputs[0].uid != p.uid
      assert cloned.inputs[1].name == "i"
      assert cloned.inputs[1].uid != i.uid
  
imports: import numpy
  import os
  import pytest
  import cntk
  from .ops_test_utils import compare_lists_of_np_arrays, AA, cntk_device
  from cntk.io import MinibatchSource, CTFDeserializer, StreamDefs, StreamDef
label_desc: Use image node_id 4 for calling a global function with example usage: test_cloning() without return types