評價此頁

interpolate#

class torch.ao.nn.quantized.functional.interpolate(input, size=None, scale_factor=None, mode='nearest', align_corners=None)[原始碼]#

將輸入下/上取樣到給定的 size 或給定的 scale_factor

有關實現細節,請參閱 torch.nn.functional.interpolate()

The input dimensions are interpreted in the form: mini-batch x channels x [optional depth] x [optional height] x width.

注意

輸入量化引數會傳播到輸出。

注意

量化輸入僅支援 2D/3D 輸入

注意

量化輸入僅支援以下模式

  • bilinear

  • nearest

引數
  • input (Tensor) – 輸入張量

  • size (intTuple[int] 或 Tuple[int, int] 或 Tuple[int, int, int]) – 輸出的空間大小。

  • scale_factor (floatTuple[float]) – 空間大小的乘數。如果為元組,則必須與輸入大小匹配。

  • mode (str) – 用於上取樣的演算法:'nearest' | 'bilinear'

  • align_corners (bool, optional) – 從幾何上講,我們將輸入和輸出的畫素視為正方形而不是點。如果設定為 True,則輸入和輸出張量將透過其角畫素的中心點對齊,從而保留角畫素的值。如果設定為 False,則輸入和輸出張量將透過其角畫素的角點對齊,並且插值使用邊界外的邊緣值填充,從而使該操作獨立於輸入大小(只要 scale_factor 保持不變)。這僅在 mode'bilinear' 時才有效。預設值:False