code: def to_sparse_tensor(att: AttributeProto) -> SparseTensor:
      """Hosts a sparse tensor."""
      shape = tuple(d for d in att.dims)  # type: ignore[attr-defined]
      return SparseTensor(
          to_array(att.values), to_array(att.indices), shape
      )
  
imports: from __future__ import annotations
  import abc
  from typing import Any, ClassVar, Iterable
  import numpy
  from onnx import TensorProto
  from onnx.defs import get_all_schemas_with_history, get_schema, onnx_opset_version
  from onnx.helper import make_node, make_tensor_type_proto, np_dtype_to_tensor_dtype
  from onnx.numpy_helper import to_array, unpack_int4
  from onnx.onnx_pb import AttributeProto, GraphProto, NodeProto, TypeProto
  from onnx.reference.custom_element_types import bfloat16, float8e4m3fn, float8e4m3fnuz, float8e5m2, float8e5m2fnuz, int4, uint4
label_desc: Use image node_id 3 for calling a global function with example usage: to_sparse_tensor(att) and returns: SparseTensor