Skip to content

Instantly share code, notes, and snippets.

@truh
Last active March 29, 2019 14:00
Show Gist options
  • Save truh/830f0dd771db786e498c57ab70df96d7 to your computer and use it in GitHub Desktop.
Save truh/830f0dd771db786e498c57ab70df96d7 to your computer and use it in GitHub Desktop.
Changelog of ONNX Upsample Operator

Upsample-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] ]]]

Version

No versioning maintained for experimental ops.

Attributes

height_scale : float (required)
The scale along height dimension. It takes value greater than or equal to 1.
mode : string (default is nearest)
Two interpolation modes: nearest(default), bilinear
width_scale : float (required)
The scale along width dimension. It takes value greater than or equal to 1.

Inputs

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

Outputs

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

Type Constraints

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

Upsample-7

Upsample the input tensor. Each dimension value of the output tensor is: output_dimension = floor(input_dimension * scale).

Version

This version of the operator has been available since version 7 of the default ONNX operator set.

Attributes

mode : string (default is nearest)
Two interpolation modes: nearest (default), and linear (including bilinear, trilinear, etc)
scales : list of floats (required)
The scale array along each dimension. It takes value greater than or equal to 1. The number of elements of 'scales' should be the same as the rank of input 'X'.

Inputs

X : T
N-D tensor

Outputs

Y : T
N-D tensor after resizing

Type Constraints

T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128)
Constrain input and output types to all tensor types.

Upsample-9

Upsample the input tensor. Each dimension value of the output tensor is: output_dimension = floor(input_dimension * scale).

Version

This version of the operator has been available since version 9 of the default ONNX operator set.

Attributes

mode : string (default is nearest)
Two interpolation modes: nearest (default), and linear (including bilinear, trilinear, etc)

Inputs

X : T
N-D tensor
scales : tensor(float)
The scale array along each dimension. It takes value greater than or equal to 1. The number of elements of 'scales' should be the same as the rank of input 'X'.

Outputs

Y : T
N-D tensor after resizing

Type Constraints

T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128)
Constrain input 'X' and output 'Y' to all tensor types.

Upsample-10 (deprecated)

Upsample the input tensor. Each dimension value of the output tensor is: output_dimension = floor(input_dimension * scale).

Version

This version of the operator has been deprecated since version 10 of the default ONNX operator set.


Resize-10

Resize the input tensor. Each dimension value of the output tensor is: output_dimension = floor(input_dimension * scale).

Version

This version of the operator has been available since version 10 of the default ONNX operator set.

Attributes

mode : string (default is nearest)
Two interpolation modes: nearest (default), and linear (including bilinear, trilinear, etc)

Inputs

X : T
N-D tensor
scales : tensor(float)
The scale array along each dimension. It takes value greater than 0. If it's less than 1, it's sampling down, otherwise, it's upsampling. The number of elements of 'scales' should be the same as the rank of input 'X'.

Outputs

Y : T
N-D tensor after resizing

Type Constraints

T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128)
Constrain input 'X' and output 'Y' to all tensor types.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment