class_docstr: Base class for all model outputs as dataclass. Has a `__getitem__` that allows indexing by integer or slice (like a
  tuple) or strings (like a dictionary) that will ignore the `None` attributes. Otherwise behaves like a regular
  python dictionary.
  
  <Tip warning={true}>
  
  You can't unpack a `ModelOutput` directly. Use the [`~utils.ModelOutput.to_tuple`] method to convert it to a tuple
  before.
  
  </Tip>
class_docstr_tok: ["Base","class","for","all","model","outputs","as","dataclass",".","Has","a","`","__getitem__","`","that","allows","indexing","by","integer","or","slice","(","like","a","tuple",")","or","strings","(","like","a","dictionary",")","that","will","ignore","the","`","None","`","attributes",".","Otherwise","behaves","like","a","regular","python","dictionary",".","<","Tip","warning=","{","true","}",">","You","ca","n't","unpack","a","`","ModelOutput","`","directly",".","Use","the","[","`","~utils.ModelOutput.to_tuple","`","]","method","to","convert","it","to","a","tuple","before",".","<","\/Tip",">"]
code: def __setattr__(self, name, value):
      if name in self.keys() and value is not None:
          # Don't call self.__setitem__ to avoid recursion errors
          super().__setitem__(name, value)
      super().__setattr__(name, value)
  
imports: import inspect
  import tempfile
  from collections import OrderedDict, UserDict
  from collections.abc import MutableMapping
  from contextlib import ExitStack, contextmanager
  from dataclasses import fields, is_dataclass
  from enum import Enum
  from typing import Any, ContextManager, Iterable, List, Tuple
  import numpy
  from .import_utils import is_flax_available, is_tf_available, is_torch_available, is_torch_fx_proxy
label_desc: Use image node_id 9 for calling the ModelOutput obj's underlying member method code with example usage: obj.__setattr__(name, value) without return types