code: def test_fullyconnected():
      def check_fullyconnected_training(stype):
          data_shape = rand_shape_nd(2)
          weight_shape = rand_shape_nd(2)
          weight_shape = (weight_shape[0], data_shape[1])
          for density in [1.0, 0.5, 0.0]:
              x = rand_ndarray(
                  shape=data_shape, stype=stype, density=density
              )
              w = rand_ndarray(
                  shape=weight_shape, stype=stype, density=density
              )
              x_sym = mx.sym.Variable("data")
              w_sym = mx.sym.Variable("weight")
              sym = mx.sym.FullyConnected(
                  data=x_sym,
                  weight=w_sym,
                  num_hidden=weight_shape[0],
                  no_bias=True,
              )
              in_location = [x, w]
              check_numeric_gradient(
                  sym,
                  in_location,
                  numeric_eps=1e-3,
                  rtol=1e-3,
                  atol=5e-3,
              )
  
      stypes = ["row_sparse", "default"]
      for stype in stypes:
          check_fullyconnected_training(stype)
  
imports: import sys
  import os
  import numpy
  import mxnet
  import pytest
  from mxnet.test_utils import rand_ndarray, assert_almost_equal
  from mxnet import gluon, context, use_np
  from mxnet.gluon import nn
  from mxnet.test_utils import *
  import itertools
label_desc: Use image node_id 18 for calling a global function with example usage: test_fullyconnected() without return types