code: def verify_equivalence(ref_v, v):
      if isinstance(ref_v, legacy_nnp_graph.NnpNetwork):
          ref_inputs = list(ref_v.inputs.values())
          inputs = list(v.inputs.values())
  
          ref_outputs = list(ref_v.outputs.values())
          outputs = list(v.outputs.values())
          for ref_d, d in zip(
              forward_variable(ref_inputs, ref_outputs, "left"),
              forward_variable(inputs, outputs, "right"),
          ):
              assert_allclose(ref_d, d)
          assert_topology(ref_outputs, outputs)
  
      elif isinstance(ref_v, nn.Variable):
          compare_nn_variable_metadata(ref_v, v)
      elif isinstance(ref_v, tuple):
          compare_nn_variable_with_name(ref_v, v)
      else:
          print("compare {} <==> {}".format(ref_v, v))
          assert ref_v == v
  
imports: import pytest
  import numpy
  import nnabla
  import nnabla.functions
  import nnabla.parametric_functions
  from nnabla.testing import assert_allclose
  from helper import get_saved_test_model, forward_variable_and_check_equal, forward_variable, assert_topology, dump_network_topology
  import legacy_nnp_graph
  from nnabla.utils import nnp_graph
label_desc: Use image node_id 8 for calling a global function with example usage: verify_equivalence(ref_v, v) without return types