code: def expand_target(
      self, tensor: Tensor, target_is_real: bool
  ) -> Tensor:
      target = self.real_label if target_is_real else self.fake_label
      return target.expand_as(tensor)
  
file_path: carefree-learn/cflearn/losses/gan.py
imports: import torch
  from torch import nn
  from torch import Tensor
  from typing import Optional
  from typing import NamedTuple
  from ..misc.toolkit import get_gradient
label_desc: Use image node_id 2 for calling the GANLoss obj's underlying member method code with example usage: obj.expand_target(tensor, target_is_real) and returns: target