Upsample - version 1#

This page documents version 1 of operator Upsample. See Upsample for the latest version (since version 10).

  • Domain: ai.onnx

  • Since version: 1

Upsample the input tensor. The width and height of the output tensor are:

output_width = floor(input_width * width_scale),
output_height = floor(input_height * height_scale).

Example:

Given `data` tensor, width_scale, height_scale, mode,
Upsample the input 4-D tensor in nearest mode:
data = [[[
    [1, 2],
    [3, 4]
]]]
width_scale = 2
height_scale = 2
mode = "nearest"
output = [[[
    [1, 1, 2, 2],
    [1, 1, 2, 2],
    [3, 3, 4, 4],
    [3, 3, 4, 4]
]]]

Inputs

  • X (T): 4-D tensor, [N,C,H,W]

Outputs

  • Y (T): 4-D tensor after resizing, [N,C,H,W]

Attributes

  • height_scale (float): The scale along height dimension. It takes value greater than or equal to 1.

  • mode (string): Two interpolation modes: nearest(default), bilinear

  • width_scale (float): The scale along width dimension. It takes value greater than or equal to 1.

Type Constraints

  • T: Constrain output types to bool, int32, int64, float16, float, double tensors. Allowed types: tensor(bool), tensor(double), tensor(float), tensor(float16), tensor(int32), tensor(int64).