code: def test_parameters_zero_grad():
      for hybridize in [False, True]:
          net = gluon.nn.HybridSequential()
          for _ in range(5):
              net.add(gluon.nn.Dense(10))
          if hybridize:
              net.hybridize()
          net.initialize()
          out = net(mx.np.ones((32, 8)))
          for v in net.collect_params().values():
              v.grad()[()] = 1
          net.zero_grad()
          for v in net.collect_params().values():
              assert_almost_equal(
                  v.grad().asnumpy(),
                  mx.np.zeros_like(v.grad()).asnumpy(),
              )
  
imports: from __future__ import absolute_import
  from __future__ import division
  import os
  from uuid import uuid4
  import numpy
  import mxnet
  from mxnet import gluon, autograd, np, npx
  from mxnet.test_utils import use_np, assert_almost_equal, check_gluon_hybridize_consistency, assert_allclose
  from mxnet.gluon import nn
  from mxnet.base import MXNetError
  import random
  import pytest
label_desc: Use image node_id 6 for calling a global function with example usage: test_parameters_zero_grad() without return types