class_docstr: Ancestor to all operators in this subfolder.
  
  Args:
      onnx_node: `onnx` node
      run_params: additional parameters such as `verbose`, `opsets`
          (it can be more than one if the operator has a subgraph),
          `log` for a logging function
      schema: operator schema
class_docstr_tok: ["Ancestor","to","all","operators","in","this","subfolder",".","Args",":","onnx_node",":","`","onnx","`","node","run_params",":","additional","parameters","such","as","`","verbose","`",",","`","opsets","`","(","it","can","be","more","than","one","if","the","operator","has","a","subgraph",")",",","`","log","`","for","a","logging","function","schema",":","operator","schema"]
docstr: Checks the output are from the expected type.
docstr_tok: ["Checks","the","output","are","from","the","expected","type","."]
code: def _check_and_fix_outputs(
      self, res: tuple[Any, ...]
  ) -> tuple[Any, ...]:
      """Checks the output are from the expected type."""
      if not isinstance(res, tuple):
          raise TypeError(
              f"Method '_run' of class {self.__class__.__name__!r} does not return a tuple but '{type(res)}'."
          )
      if not res:
          raise ValueError(
              f"Method '_run' of class {self.__class__.__name__!r} does not return any result."
          )
      if any(isinstance(t, tuple) for t in res):
          dtypes = [type(t) for t in res]
          raise TypeError(
              f"One of the results returned by method '_run' of class {self.__class__.__name__!r} "
              f"is a tuple, this is no ONNX corresponding type (Map, List, Tensor, SparseTensor). "
              f"All returned types: {dtypes!r}."
          )
      res = tuple(  # type: ignore[assignment]
          (np.array(x) if np.isscalar(x) else x) for x in res
      )
      if any(
          not (
              isinstance(t, (np.ndarray, list, dict))
              or hasattr(t, "todense")
          )
          for t in res
      ):
          dtypes = [type(t) for t in res]
          raise TypeError(
              f"One of the results returned by method '_run' of class {self.__class__.__name__!r} "
              f"has an unexpected type, this is no ONNX correponding type (Map, List, Tensor, SparseTensor). "
              f"All returned types: {dtypes!r}."
          )
      return res
  
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 14 for calling the OpRun obj's underlying member method code with example usage: obj._check_and_fix_outputs(res) and returns: res