class_docstr: Base class for all models.
  
  [`ModelMixin`] takes care of storing the model configuration and provides methods for loading, downloading and
  saving models.
  
      - **config_name** ([`str`]) -- Filename to save a model to when calling [`~models.ModelMixin.save_pretrained`].
class_docstr_tok: ["Base","class","for","all","models",".","[","`","ModelMixin","`","]","takes","care","of","storing","the","model","configuration","and","provides","methods","for","loading",",","downloading","and","saving","models",".","-","*","*","config_name","*","*","(","[","`","str","`","]",")","--","Filename","to","save","a","model","to","when","calling","[","`","~models.ModelMixin.save_pretrained","`","]","."]
code: def set_use_memory_efficient_attention_xformers(
      self, valid: bool, attention_op: Optional[Callable] = None
  ) -> None:
      # Recursively walk through all the children.
      # Any children which exposes the set_use_memory_efficient_attention_xformers method
      # gets the message
      def fn_recursive_set_mem_eff(module: torch.nn.Module):
          if hasattr(
              module, "set_use_memory_efficient_attention_xformers"
          ):
              module.set_use_memory_efficient_attention_xformers(
                  valid, attention_op
              )
  
          for child in module.children():
              fn_recursive_set_mem_eff(child)
  
      for module in self.children():
          if isinstance(module, torch.nn.Module):
              fn_recursive_set_mem_eff(module)
  
imports: import inspect
  import itertools
  import os
  import re
  from functools import partial
  from typing import Any, Callable, List, Optional, Tuple, Union
  import safetensors
  import torch
  from huggingface_hub import create_repo
  from torch import Tensor, device, nn
  from ..None import __version__
  from ..utils import CONFIG_NAME, DIFFUSERS_CACHE, FLAX_WEIGHTS_NAME, HF_HUB_OFFLINE, MIN_PEFT_VERSION, SAFETENSORS_WEIGHTS_NAME, WEIGHTS_NAME, _add_variant, _get_model_file, check_peft_version, deprecate, is_accelerate_available, is_torch_version, logging
  from ..utils.hub_utils import PushToHubMixin
label_desc: Use image node_id 6 for calling the ModelMixin obj's underlying member method code with example usage: obj.set_use_memory_efficient_attention_xformers(valid, attention_op) without return types