code: def mask_by_condition(tensor, cond, fill_value):
      """This function will mask some element in the tensor with fill_value, if condition=False.
  
      Arguments
      ---------
      tensor : torch.Tensor
          The tensor to be masked.
      cond : torch.BoolTensor
          This tensor has to be the same size as tensor.
          Each element represents whether to keep the value in tensor.
      fill_value : float
          The value to fill in the masked element.
  
      Returns
      -------
      torch.Tensor
          The masked tensor.
  
      Example
      -------
      >>> tensor = torch.Tensor([[1,2,3], [4,5,6]])
      >>> cond = torch.BoolTensor([[True, True, False], [True, False, False]])
      >>> mask_by_condition(tensor, cond, 0)
      tensor([[1., 2., 0.],
              [4., 0., 0.]])
      """
      return torch.where(cond, tensor, fill_value)
  
imports: import torch
label_desc: Use image node_id 3 for calling a global function with example usage: mask_by_condition(tensor, cond, fill_value) and returns: torch