class_docstr: Inspired by: https://github.com/haofanwang/ControlNet-for-Diffusers/
class_docstr_tok: ["Inspired","by",":","https",":","\/\/github.com\/haofanwang\/ControlNet-for-Diffusers\/"]
docstr: Returns the device on which the pipeline's models will be executed. After calling
  `pipeline.enable_sequential_cpu_offload()` the execution device can only be inferred from Accelerate's module
  hooks.
docstr_tok: ["Returns","the","device","on","which","the","pipeline","'s","models","will","be","executed",".","After","calling","`","pipeline.enable_sequential_cpu_offload","(",")","`","the","execution","device","can","only","be","inferred","from","Accelerate","'s","module","hooks","."]
code: def _execution_device(self):
      r"""
      Returns the device on which the pipeline's models will be executed. After calling
      `pipeline.enable_sequential_cpu_offload()` the execution device can only be inferred from Accelerate's module
      hooks.
      """
      if not hasattr(self.unet, "_hf_hook"):
          return self.device
      for module in self.unet.modules():
          if (
              hasattr(module, "_hf_hook")
              and hasattr(module._hf_hook, "execution_device")
              and module._hf_hook.execution_device is not None
          ):
              return torch.device(module._hf_hook.execution_device)
      return self.device
  
imports: import inspect
  from typing import Any, Callable, Dict, List, Optional, Tuple, Union
  import numpy
  import PIL.Image
  import torch
  import torch.nn.functional
  from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer
  from diffusers import AutoencoderKL, ControlNetModel, DiffusionPipeline, UNet2DConditionModel, logging
  from diffusers.pipelines.stable_diffusion import StableDiffusionPipelineOutput, StableDiffusionSafetyChecker
  from diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion_controlnet import MultiControlNetModel
  from diffusers.schedulers import KarrasDiffusionSchedulers
  from diffusers.utils import PIL_INTERPOLATION, is_accelerate_available, is_accelerate_version, replace_example_docstring
  from diffusers.utils.torch_utils import randn_tensor
label_desc: Use image node_id 6 for calling the StableDiffusionControlNetInpaintPipeline obj's underlying member method code with example usage: obj._execution_device() and returns: self, self, torch