code: def test_load_save_symbol():
      batch_size = 10
      num_hdidden = 128
      num_features = 784
  
      def get_net():
          data = mx.sym.var("data")
          weight = mx.sym.var("weight", shape=(num_hdidden, 0))
          return mx.sym.FullyConnected(
              data, weight, num_hidden=num_hdidden
          )
  
      for flag1 in [False, True]:
          with np_shape(flag1):
              net_json_str = get_net().tojson()
              net_data = json.loads(net_json_str)
              assert "attrs" in net_data
              if flag1:
                  assert "is_np_shape" in net_data["attrs"]
              else:
                  assert "is_np_shape" not in net_data["attrs"]
  
          with TemporaryDirectory() as work_dir:
              fname = os.path.join(work_dir, "test_sym.json")
              with open(fname, "w") as fp:
                  json.dump(net_data, fp)
  
              # test loading 1.5.0 symbol file since 1.6.0
              # w/ or w/o np_shape semantics
              for flag2 in [False, True]:
                  if (
                      flag1
                  ):  # Do not need to test this case since 0 indicates zero-size dim
                      continue
                  with np_shape(flag2):
                      net = mx.sym.load(fname)
                      (
                          arg_shapes,
                          out_shapes,
                          aux_shapes,
                      ) = net.infer_shape(
                          data=(batch_size, num_features)
                      )
                      assert arg_shapes[0] == (
                          batch_size,
                          num_features,
                      )  # data
                      assert arg_shapes[1] == (
                          num_hdidden,
                          num_features,
                      )  # weight
                      assert arg_shapes[2] == (num_hdidden,)  # bias
                      assert out_shapes[0] == (
                          batch_size,
                          num_hdidden,
                      )  # output
                      assert len(aux_shapes) == 0
  
imports: import copy
  import sys
  import os
  import logging
  import re
  import json
  import mxnet
  import numpy
  from common import assertRaises, models, TemporaryDirectory
  from mxnet.base import NotImplementedForSymbol
  from mxnet.test_utils import discard_stderr, rand_shape_nd, use_np, environment
  from mxnet.util import np_shape
  import pickle
label_desc: Use image node_id 22 for calling a global function with example usage: test_load_save_symbol() and returns: mx