class_docstr: Internal W&B Artifact model storage.
  
  _model_type_id: (str) The id of the SavedModel subclass used to serialize the model.
class_docstr_tok: ["Internal","W","&","B","Artifact","model","storage",".","_model_type_id",":","(","str",")","The","id","of","the","SavedModel","subclass","used","to","serialize","the","model","."]
code: def _maybe_init(
      cls: Type["_SavedModel"], obj_or_path: Any, **kwargs: Any
  ) -> Optional["_SavedModel"]:
      # _maybe_init is an exception-safe method that will return an instance of this class
      # (or any subclass of this class - recursively) OR None if no subclass constructor is found.
      # We first try the current class, then recursively call this method on children classes. This pattern
      # conforms to the new "Weave-type" pattern developed by Shawn. This way, we can for example have a
      # pytorch subclass that can itself have two subclasses: one for a TorchScript model, and one for a PyTorch model.
      # The children subclasses will know how to serialize/deserialize their respective payloads, but the pytorch
      # parent class can know how to execute inference on the model - regardless of serialization strategy.
      try:
          return cls(obj_or_path, **kwargs)
      except Exception as e:
          if DEBUG_MODE:
              print(f"{cls}._maybe_init({obj_or_path}) failed: {e}")
          pass
  
      for child_cls in cls.__subclasses__():
          maybe_instance = child_cls._maybe_init(obj_or_path, **kwargs)
          if maybe_instance is not None:
              return maybe_instance
  
      return None
  
imports: import os
  import shutil
  import sys
  from typing import TYPE_CHECKING, Any, ClassVar, Generic, List, Optional, Type, TypeVar, Union, cast
  import wandb
  from wandb import util
  from wandb.sdk.lib import runid
  from wandb.sdk.lib.hashutil import md5_file_hex
  from wandb.sdk.lib.paths import LogicalPath
  from ._private import MEDIA_TMP
  from .base_types.wb_value import WBValue
label_desc: Use image node_id 9 for calling the _SavedModel obj's underlying member method code with example usage: obj._maybe_init(cls, obj_or_path) and returns: None, cls, maybe_instance