code: def get_alpha(
      self, image_only_indicator: torch.Tensor
  ) -> torch.Tensor:
      if self.merge_strategy == "fixed":
          alpha = self.mix_factor
      elif self.merge_strategy == "learned":
          alpha = torch.sigmoid(self.mix_factor)
      elif self.merge_strategy == "learned_with_images":
          assert (
              image_only_indicator is not None
          ), "need image_only_indicator ..."
          alpha = torch.where(
              image_only_indicator.bool(),
              torch.ones(1, 1, device=image_only_indicator.device),
              rearrange(torch.sigmoid(self.mix_factor), "... -> ... 1"),
          )
          alpha = rearrange(alpha, self.rearrange_pattern)
      else:
          raise NotImplementedError
      return alpha
  
imports: import math
  from typing import Optional
  import torch
  import torch.nn
  from einops import rearrange, repeat
label_desc: Use image node_id 2 for calling the AlphaBlender obj's underlying member method code with example usage: obj.get_alpha(image_only_indicator) and returns: alpha