code: def transform_fn(net, data, input_content_type, output_content_type):
      assert input_content_type == "application/json"
      assert output_content_type == "application/json"
  
      # parsed should be a 1d array of length 728
      parsed = json.loads(data)
      parsed = parsed["inputs"]
  
      # convert to numpy array
      arr = np.array(parsed).reshape(-1, 1, 28, 28)
  
      # convert to mxnet ndarray
      nda = mx.nd.array(arr)
  
      output = net(nda)
  
      prediction = mx.nd.argmax(output, axis=1)
      response_body = json.dumps(prediction.asnumpy().tolist())
  
      return response_body, output_content_type
  
file_path: sagemaker-python-sdk/tests/data/mxnet_mnist/code/inference.py
imports: from __future__ import print_function
  import json
  import logging
  import os
  import mxnet
  import numpy
  from mxnet import gluon
label_desc: Use image node_id 2 for calling a global function with example usage: transform_fn(net, data, input_content_type, output_content_type) and returns: response_body,  output_content_type