code: def add_scaled_condition(
      self,
      target: torch.Tensor,
      condition: torch.Tensor,
      condition_lengths: torch.Tensor,
  ):
      *_, target_height, _ = target.shape
      *_, height, _ = condition.shape
  
      scale = height // target_height
  
      # scale appropriately
      condition = F.interpolate(
          condition, size=target.shape[-2:], mode="bilinear"
      )
  
      # add and mask
      result = (target + condition) / 2
      result = mask_sequence_tensor(
          result, (condition_lengths / scale).ceil().long()
      )
  
      return result
  
imports: import math
  from functools import partial
  from math import log2
  from typing import List
  import torch
  import torch.nn.functional
  from einops import rearrange
  from kornia.filters import filter2d
  from nemo.collections.tts.parts.utils.helpers import mask_sequence_tensor
label_desc: Use image node_id 2 for calling the Generator obj's underlying member method code with example usage: obj.add_scaled_condition(target, condition, condition_lengths) and returns: result