code: def test_estimator_gpu():
      """
      Test estimator by training resnet18_v1 for 5 epochs on MNIST and verify accuracy
      """
      model_name = "resnet18_v1"
      batch_size = 128
      num_epochs = 5
      context = mx.gpu(0)
      net, _, _, _ = get_net(model_name, context)
      train_data, test_data = load_data_mnist(batch_size, resize=224)
      loss = gluon.loss.SoftmaxCrossEntropyLoss()
      net.hybridize()
      acc = mx.gluon.metric.Accuracy()
      trainer = gluon.Trainer(
          net.collect_params(), "sgd", {"learning_rate": 0.001}
      )
      # Define estimator
      est = estimator.Estimator(
          net=net,
          loss=loss,
          train_metrics=acc,
          trainer=trainer,
          context=context,
      )
      # Call fit()
      est.fit(
          train_data=train_data, val_data=test_data, epochs=num_epochs
      )
  
      assert acc.get()[1] > 0.80
  
file_path: mxnet/tests/nightly/estimator/test_estimator_cnn.py
imports: import os
  import sys
  import mxnet
  import numpy
  from mxnet import gluon, init, nd
  from mxnet.gluon import data
  from mxnet.gluon.contrib.estimator import estimator
  from mxnet.gluon.model_zoo import vision
  import pytest
label_desc: Use image node_id 5 for calling a global function with example usage: test_estimator_gpu() without return types