code: def _blend(img1: Tensor, img2: Tensor, ratio: float) -> Tensor:
      ratio = float(ratio)
      bound = _max_value(img1.dtype)
      return (
          (ratio * img1 + (1.0 - ratio) * img2)
          .clamp(0, bound)
          .to(img1.dtype)
      )
  
imports: import warnings
  from typing import List, Optional, Tuple, Union
  import torch
  from torch import Tensor
  from torch.nn.functional import conv2d, grid_sample, interpolate, pad
label_desc: Use image node_id 18 for calling a global function with example usage: _blend(img1, img2, ratio) and returns: unknown