code: def test_output_format_cond():
      class TestLayer1(gluon.HybridBlock):
          def __init__(self, func):
              super(TestLayer1, self).__init__()
              self.func = func
  
          def forward(self, data):
              def then_func(data):
                  return self.func(data)
  
              def else_func(data):
                  return self.func(data)
  
              return mx.npx.cond(
                  lambda data: mx.npx.slice(data, begin=0, end=1),
                  then_func,
                  else_func,
                  data,
              )
  
      def func1(data):
          return data
  
      def func2(data):
          return [data]
  
      def func3(data):
          return [data, data]
  
      funcs = [func1, func2, func3]
      data = mx.np.random.normal(loc=0, scale=1, size=(2))
      for func in funcs:
          layer1 = TestLayer1(func)
          layer1.initialize(device=default_device())
          layer2 = TestLayer1(func)
          layer2.initialize(device=default_device())
          layer2.hybridize()
          out1 = layer1(data)
          out2 = layer2(data)
          func_out = func(data)
          assert type(out1) == type(func_out)
          assert type(out2) == type(func_out)
          out1 = _as_list(out1)
          out2 = _as_list(out2)
          for i in range(len(out1)):
              assert_almost_equal(
                  out1[i].asnumpy(),
                  out2[i].asnumpy(),
                  rtol=0.001,
                  atol=0.0001,
              )
  
imports: import copy
  import numpy
  import mxnet
  from mxnet import gluon
  from mxnet.test_utils import *
  from mxnet.base import _as_list
  from collections import defaultdict
  from mxnet.attribute import AttrScope
label_desc: Use image node_id 8 for calling a global function with example usage: test_output_format_cond() and returns: data, list, list, mx, self, self