code: def test_np_zeros():
      # test np.zeros in Gluon
      class TestZeros(HybridBlock):
          def __init__(self, shape, dtype=None):
              super(TestZeros, self).__init__()
              self._shape = shape
              self._dtype = dtype
  
          def forward(self, x, *args, **kwargs):
              return x + np.zeros(shape, dtype=dtype)
  
      class TestZerosOutputType(HybridBlock):
          def forward(self, x, *args, **kwargs):
              return x, np.zeros(shape=())
  
      # test np.zeros in imperative
      def check_zero_array_creation(shape, dtype):
          np_out = _np.zeros(shape=shape, dtype=dtype)
          mx_out = np.zeros(shape=shape, dtype=dtype)
          assert same(mx_out.asnumpy(), np_out)
          if dtype is None:
              assert mx_out.dtype == _np.float32
              assert np_out.dtype == _np.float64
          else:
              assert mx_out.dtype == np_out.dtype
  
      shapes = [(0,), (2, 0, 2), (0, 0, 0, 0), ()]
      shapes += [
          rand_shape_nd(ndim, allow_zero_size=True) for ndim in range(5)
      ]
      dtypes = [
          _np.int8,
          _np.int32,
          _np.float16,
          _np.float32,
          _np.float64,
          None,
      ]
      for shape in shapes:
          for dtype in dtypes:
              check_zero_array_creation(shape, dtype)
              x = np.array(_np.random.uniform(size=shape), dtype=dtype)
              if dtype is None:
                  x = x.astype("float32")
              for hybridize in [True, False]:
                  test_zeros = TestZeros(shape, dtype)
                  test_zeros_output_type = TestZerosOutputType()
                  if hybridize:
                      test_zeros.hybridize()
                      test_zeros_output_type.hybridize()
                  y = test_zeros(x)
                  assert type(y) == np.ndarray
                  assert same(x.asnumpy(), y.asnumpy())
                  y = test_zeros_output_type(x)
                  assert type(y[1]) == np.ndarray
  
      for shape in shapes:
          for dtype in [_np.bool, bool, _np.bool, "bool"]:
              check_zero_array_creation(shape, dtype)
  
imports: from __future__ import absolute_import
  from __future__ import division
  import itertools
  import os
  import pytest
  import operator
  import numpy
  import mxnet
  from mxnet import np, npx, autograd
  from mxnet.gluon import HybridBlock
  from mxnet.test_utils import same, assert_almost_equal, rand_shape_nd, rand_ndarray, use_np
  from common import retry, TemporaryDirectory, xfail_when_nonstandard_decimal_separator
  from mxnet.test_utils import verify_generator, gen_buckets_probs_with_ppf, assert_exception, is_op_runnable, collapse_sum_like
  from mxnet.ndarray.ndarray import py_slice
  from mxnet.base import integer_types
label_desc: Use image node_id 3 for calling a global function with example usage: test_np_zeros() and returns: unknown, x,  np