code: def test_initializer():
      """test with no initializer, inconsistent initializer"""
      net = _get_test_network()
      train_data, _ = _get_test_data()
      num_epochs = 1
      device = mx.cpu()
  
      loss = gluon.loss.L2Loss()
      acc = mx.gluon.metric.Accuracy()
      # no initializer
      est = Estimator(
          net=net, loss=loss, train_metrics=acc, device=device
      )
      est.fit(train_data=train_data, epochs=num_epochs)
  
      # different initializer for net and estimator
      net = _get_test_network()
      net.initialize(mx.init.Xavier(), device=device)
      trainer = gluon.Trainer(
          net.collect_params(), "sgd", {"learning_rate": 0.001}
      )
      # catch reinit warning
      with warnings.catch_warnings(record=True) as w:
          est = Estimator(
              net=net,
              loss=loss,
              train_metrics=acc,
              initializer=mx.init.MSRAPrelu(),
              trainer=trainer,
              device=device,
          )
          assert "Network already fully initialized" in str(
              w[-1].message
          )
      # net partially initialized, fine tuning use case
      net = gluon.model_zoo.vision.resnet18_v1(
          pretrained=False, device=device
      )
      net.features.initialize(device=device)
      net.features(mx.np.zeros((1, 3, 224, 224)))
      net.output = gluon.nn.Dense(10)  # last layer not initialized
      est = Estimator(net, loss=loss, train_metrics=acc, device=device)
      dataset = gluon.data.ArrayDataset(
          mx.np.zeros((10, 3, 224, 224)), mx.np.zeros((10, 10))
      )
      train_data = gluon.data.DataLoader(dataset=dataset, batch_size=5)
      est.fit(train_data=train_data, epochs=num_epochs)
  
imports: import sys
  import unittest
  import warnings
  import pytest
  import mxnet
  from mxnet import gluon
  from mxnet.gluon import nn
  from mxnet.gluon.contrib.estimator import *
  from mxnet.gluon.contrib.estimator.event_handler import *
label_desc: Use image node_id 5 for calling a global function with example usage: test_initializer() without return types