Resize

Resize - 19

版本

  • 名称: Resize (GitHub)

  • : main

  • 起始版本: 19

  • 函数: False

  • 支持级别: SupportType.COMMON

  • Shape 推理: True

此版本的算子已可用,**自版本 19 起**。

摘要

调整输入张量的大小。通常,它将输出张量中的每个值计算为输入张量中邻域(也称为采样位置)的加权平均值。输出张量的每个维度值是

output_dimension = floor(input_dimension * (roi_end - roi_start) * scale)

如果未指定输入“sizes”。

属性

  • **antialias - INT** (默认值为 '0')

    如果设置为 1,则“linear”和“cubic”插值模式在下采样时将使用抗锯齿滤波器。抗锯齿通过将重采样滤波器拉伸 max(1, 1 / scale) 因子来实现,这意味着在下采样时,更多的输入像素会贡献给一个输出像素。

  • axes - INTS :

    如果提供,它指定了 ‘roi’、‘scales’ 和 ‘sizes’ 所引用的轴的子集。如果未提供,则假定所有轴都是 [0, 1, …, r-1],其中 r = rank(data)。未指定的维度被解释为不可调整大小。负值表示从后面计数维度。接受的范围是 [-r, r-1],其中 r = rank(data)。如果一个轴被重复,则行为未定义。

  • **coordinate_transformation_mode - STRING** (默认值为 'half_pixel')

    此属性描述了如何将调整大小后的张量中的坐标转换为原始张量中的坐标。

    每个维度的坐标都单独进行转换。让我们以轴 x 为例进行描述。将 x_resized 表示为调整大小后的张量中轴 x 的坐标,x_original 表示为原始张量中轴 x 的坐标,length_original 表示为原始张量在轴 x 上的长度,length_resized 表示为调整大小后的张量在轴 x 上的长度,scale = length_resized / length_originaloutput_width 表示轴 x 上的目标长度,当它由比例因子计算得出时可以是小数,output_width_int 表示作为整数的有效输出宽度。

    if coordinate_transformation_mode is "half_pixel",

    x_original = (x_resized + 0.5) / scale - 0.5
    

    if coordinate_transformation_mode is "half_pixel_symmetric",

    adjustment = output_width_int / output_width
    center = input_width / 2
    offset = center * (1 - adjustment)
    x_ori = offset + (x + 0.5) / scale - 0.5
    

    if coordinate_transformation_mode is "pytorch_half_pixel",

    x_original = length_resized > 1 ? (x_resized + 0.5) / scale - 0.5 : 0
    

    if coordinate_transformation_mode is "align_corners",

    x_original = x_resized * (length_original - 1) / (length_resized - 1)
    

    if coordinate_transformation_mode is "asymmetric",

    x_original = x_resized / scale
    

    if coordinate_transformation_mode is "tf_crop_and_resize",

    x_original = length_resized > 1 ? start_x * (length_original - 1) + x_resized * (end_x - start_x) * (length_original - 1) / (length_resized - 1) : 0.5 * (start_x + end_x) * (length_original - 1)
    

    .

  • **cubic_coeff_a - FLOAT** (默认值为 '-0.75')

    立方插值中使用的系数 ‘a’。两种常见的选择是 -0.5(在 TensorFlow 的某些情况下)和 -0.75(在 PyTorch 中)。详情请参阅 https://ieeexplore.ieee.org/document/1163711 中的公式 (4)。此属性仅在 mode 为“cubic”时有效。

  • **exclude_outside - INT** (默认值为 '0')

    如果设置为 1,则张量外部采样位置的权重将被设置为 0,并且权重将被重新归一化,使其总和为 1.0。默认值为 0。

  • **extrapolation_value - FLOAT** (默认值为 '0.0')

    当 coordinate_transformation_mode 为“tf_crop_and_resize”且 x_original 在范围 [0, length_original - 1] 之外时,此值用作对应的输出值。默认值为 0.0f。

  • **keep_aspect_ratio_policy - STRING** (默认值为 'stretch')

    此属性描述了如何解释 sizes 输入以保持输入的原始纵横比,当使用 scales 输入时此属性不适用。

    给定一组 sizes,与 axes 的子集相关联(明确提供或默认),并假设 d = axes[i],其中 i 是提供的 sizes 的索引。

    如果 keep_aspect_ratio_policy"stretch",则忽略原始纵横比,并将输入调整到指定大小:out_size[d] = sizes[i]

    如果 keep_aspect_ratio_policy"not_larger",则调整大小,使得输出的任何范围都不大于指定大小,同时保持原始纵横比

    scale = Min(sizes[i] / in_size[d])
    out_size[d] = round_int(scale * in_size[i])
    

    如果 keep_aspect_ratio_policy"not_smaller",则调整大小,使得输出的任何范围都不小于指定大小,同时保持原始纵横比

    scale = Max(sizes[i] / in_size[d])
    out_size[d] = round_int(scale * in_size[i])
    

    对于不可调整大小的轴(未在 axes 中指定的轴),输出大小将等于输入大小。

    注意:round_int 表示计算最近的整数值,半路向上取整。

  • **mode - STRING** (默认值为 'nearest')

    三种插值模式:“nearest”(默认)、“linear”和“cubic”。“linear”模式包括一维张量的线性插值和 N 维张量的 N 线性插值(例如,二维张量的双线性插值)。“cubic”模式包括一维张量的三次插值和 N 维张量的 N 次插值(例如,二维张量的双三次插值)。

  • **nearest_mode - STRING** (默认值为 'round_prefer_floor')

    四种模式:“round_prefer_floor”(默认,也称为向下舍入一半)、“round_prefer_ceil”(也称为向上舍入一半)、“floor”、“ceil”。仅用于最近邻插值。它表示如何从 x_original 获取输入张量中的“最近”像素,因此此属性仅在“mode”为“nearest”时有效。

输入

1 到 4 个输入。

  • **X** (异构) - **T1**

    N 维张量

  • **roi** (可选,异构) - **T2**

    给定为 [start1, …, startN, end1, …, endN] 的一维张量,其中 N 是 X 的秩或(如果提供)axes 的长度。RoI 的坐标在输入图像的坐标系中进行归一化。它仅在 coordinate_transformation_mode 为“tf_crop_and_resize”时生效。

  • **scales** (可选,异构) - **tensor(float)**

    沿每个维度的比例数组。其值大于 0。如果小于 1,则为下采样,否则为上采样。‘scales’ 的元素数量应与输入‘X’的秩或(如果提供)‘axes’的长度相同。必须指定‘scales’和‘sizes’之一,如果两者都指定则会出错。如果需要‘sizes’,用户可以在此算子的输入列表中使用空字符串作为‘scales’的名称。

  • **sizes** (可选,异构) - **tensor(int64)**

    输出张量的目标大小。其解释取决于‘keep_aspect_ratio_policy’的值。‘sizes’的元素数量应与输入‘X’的秩或(如果提供)‘axes’的长度相同。只能指定‘scales’和‘sizes’中的一个。

输出

  • **Y** (异构) - **T1**

    调整大小后的 N 维张量

类型约束

  • **T1** in ( tensor(bfloat16), tensor(bool), tensor(complex128), tensor(complex64), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) )

    将输入‘X’和输出‘Y’约束为所有张量类型。

  • **T2** in ( tensor(double), tensor(float), tensor(float16) )

    将 roi 类型约束为 float 或 double。

Resize - 18

版本

  • 名称: Resize (GitHub)

  • : main

  • **起始版本**: 18

  • 函数: False

  • 支持级别: SupportType.COMMON

  • Shape 推理: True

此版本的算子已可用,**自版本 18 起**。

摘要

调整输入张量的大小。通常,它将输出张量中的每个值计算为输入张量中邻域(也称为采样位置)的加权平均值。输出张量的每个维度值是
output_dimension = floor(input_dimension * (roi_end - roi_start) * scale)
如果未指定输入“sizes”。

属性

  • **antialias - INT** (默认值为 '0')

    如果设置为 1,则“linear”和“cubic”插值模式在下采样时将使用抗锯齿滤波器。抗锯齿通过将重采样滤波器拉伸 max(1, 1 / scale) 因子来实现,这意味着在下采样时,更多的输入像素会贡献给一个输出像素。

  • axes - INTS :

    如果提供,它指定了 ‘roi’、‘scales’ 和 ‘sizes’ 所引用的轴的子集。如果未提供,则假定所有轴都是 [0, 1, …, r-1],其中 r = rank(data)。未指定的维度被解释为不可调整大小。负值表示从后面计数维度。接受的范围是 [-r, r-1],其中 r = rank(data)。如果一个轴被重复,则行为未定义。

  • **coordinate_transformation_mode - STRING** (默认值为 'half_pixel')

    此属性描述了如何将调整大小后的张量中的坐标转换为原始张量中的坐标。

    每个维度的坐标都单独进行转换。让我们以轴 x 为例进行描述。将 x_resized 表示为调整大小后的张量中轴 x 的坐标,x_original 表示为原始张量中轴 x 的坐标,length_original 表示为原始张量在轴 x 上的长度,length_resized 表示为调整大小后的张量在轴 x 上的长度,roi_x = (start_x, end_x) 表示输入“roi”中轴 x 的范围,scale = length_resized / length_original

    if coordinate_transformation_mode is "half_pixel",
    x_original = (x_resized + 0.5) / scale - 0.5

    if coordinate_transformation_mode is "pytorch_half_pixel",
    x_original = length_resized > 1 ? (x_resized + 0.5) / scale - 0.5 : 0

    if coordinate_transformation_mode is "align_corners",
    x_original = x_resized * (length_original - 1) / (length_resized - 1)

    if coordinate_transformation_mode is "asymmetric",
    x_original = x_resized / scale

    if coordinate_transformation_mode is "tf_crop_and_resize",
    x_original = length_resized > 1 ? start_x * (length_original - 1) + x_resized * (end_x - start_x) * (length_original - 1) / (length_resized - 1) : 0.5 * (start_x + end_x) * (length_original - 1) .

  • **cubic_coeff_a - FLOAT** (默认值为 '-0.75')

    立方插值中使用的系数 ‘a’。两种常见的选择是 -0.5(在 TensorFlow 的某些情况下)和 -0.75(在 PyTorch 中)。详情请参阅 https://ieeexplore.ieee.org/document/1163711 中的公式 (4)。此属性仅在 mode 为“cubic”时有效。

  • **exclude_outside - INT** (默认值为 '0')

    如果设置为 1,则张量外部采样位置的权重将被设置为 0,并且权重将被重新归一化,使其总和为 1.0。默认值为 0。

  • **extrapolation_value - FLOAT** (默认值为 '0.0')

    当 coordinate_transformation_mode 为“tf_crop_and_resize”且 x_original 在范围 [0, length_original - 1] 之外时,此值用作对应的输出值。默认值为 0.0f。

  • **keep_aspect_ratio_policy - STRING** (默认值为 'stretch')

    此属性描述了如何解释 sizes 输入以保持输入的原始纵横比,当使用 scales 输入时此属性不适用。

    给定一组 sizes,与 axes 的子集相关联(明确提供或默认),并假设 d = axes[i],其中 i 是提供的 sizes 的索引。

    If keep_aspect_ratio_policy is "stretch", the original aspect ratio is disregarded, and the input is resized to the specified size
    out_size[d] = sizes[i]

    如果 keep_aspect_ratio_policy"not_larger",则调整大小,使得输出的任何范围都不大于指定大小,同时保持原始纵横比
    scale = Min(sizes[i] / in_size[d])
    out_size[d] = round_int(scale * in_size[i])

    如果 keep_aspect_ratio_policy"not_smaller",则调整大小,使得输出的任何范围都不小于指定大小,同时保持原始纵横比
    scale = Max(sizes[i] / in_size[d])
    out_size[d] = round_int(scale * in_size[i])

    对于不可调整大小的轴(未在 axes 中指定的轴),输出大小将等于输入大小。

    注意:round_int 表示计算最近的整数值,半路向上取整。

  • **mode - STRING** (默认值为 'nearest')

    三种插值模式:“nearest”(默认)、“linear”和“cubic”。“linear”模式包括一维张量的线性插值和 N 维张量的 N 线性插值(例如,二维张量的双线性插值)。“cubic”模式包括一维张量的三次插值和 N 维张量的 N 次插值(例如,二维张量的双三次插值)。

  • **nearest_mode - STRING** (默认值为 'round_prefer_floor')

    四种模式:“round_prefer_floor”(默认,也称为向下舍入一半)、“round_prefer_ceil”(也称为向上舍入一半)、“floor”、“ceil”。仅用于最近邻插值。它表示如何从 x_original 获取输入张量中的“最近”像素,因此此属性仅在“mode”为“nearest”时有效。

输入

1 到 4 个输入。

  • **X** (异构) - **T1**

    N 维张量

  • **roi** (可选,异构) - **T2**

    给定为 [start1, …, startN, end1, …, endN] 的一维张量,其中 N 是 X 的秩或(如果提供)axes 的长度。RoI 的坐标在输入图像的坐标系中进行归一化。它仅在 coordinate_transformation_mode 为“tf_crop_and_resize”时生效。

  • **scales** (可选,异构) - **tensor(float)**

    沿每个维度的比例数组。其值大于 0。如果小于 1,则为下采样,否则为上采样。‘scales’ 的元素数量应与输入‘X’的秩或(如果提供)‘axes’的长度相同。必须指定‘scales’和‘sizes’之一,如果两者都指定则会出错。如果需要‘sizes’,用户可以在此算子的输入列表中使用空字符串作为‘scales’的名称。

  • **sizes** (可选,异构) - **tensor(int64)**

    输出张量的目标大小。其解释取决于‘keep_aspect_ratio_policy’的值。‘sizes’的元素数量应与输入‘X’的秩或(如果提供)‘axes’的长度相同。只能指定‘scales’和‘sizes’中的一个。

输出

  • **Y** (异构) - **T1**

    调整大小后的 N 维张量

类型约束

  • **T1** in ( tensor(bfloat16), tensor(bool), tensor(complex128), tensor(complex64), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) )

    将输入‘X’和输出‘Y’约束为所有张量类型。

  • **T2** in ( tensor(double), tensor(float), tensor(float16) )

    将 roi 类型约束为 float 或 double。

Resize - 13

版本

  • 名称: Resize (GitHub)

  • : main

  • **起始版本**: 13

  • 函数: False

  • 支持级别: SupportType.COMMON

  • Shape 推理: True

此版本的算子已可用,**自版本 13 起**。

摘要

调整输入张量的大小。通常,它将输出张量中的每个值计算为输入张量中邻域(也称为采样位置)的加权平均值。如果未指定输入“sizes”,则输出张量的每个维度值是:output_dimension = floor(input_dimension * (roi_end - roi_start) * scale)。

属性

  • **coordinate_transformation_mode - STRING** (默认值为 'half_pixel')

    此属性描述了如何将调整大小后的张量中的坐标转换为原始张量中的坐标。

    每个维度的坐标都单独进行转换。让我们以轴 x 为例进行描述。将 x_resized 表示为调整大小后的张量中轴 x 的坐标,x_original 表示为原始张量中轴 x 的坐标,length_original 表示为原始张量在轴 x 上的长度,length_resized 表示为调整大小后的张量在轴 x 上的长度,roi_x = (start_x, end_x) 表示输入“roi”中轴 x 的范围,scale = length_resized / length_original,

    if coordinate_transformation_mode is “half_pixel”,
    x_original = (x_resized + 0.5) / scale - 0.5,

    if coordinate_transformation_mode is “pytorch_half_pixel”,
    x_original = length_resized > 1 ? (x_resized + 0.5) / scale - 0.5 : 0,

    if coordinate_transformation_mode is “align_corners”,
    x_original = x_resized * (length_original - 1) / (length_resized - 1),

    if coordinate_transformation_mode is “asymmetric”,
    x_original = x_resized / scale,

    if coordinate_transformation_mode is “tf_crop_and_resize”,
    x_original = length_resized > 1 ? start_x * (length_original - 1) + x_resized * (end_x - start_x) * (length_original - 1) / (length_resized - 1) : 0.5 * (start_x + end_x) * (length_original - 1)。

  • **cubic_coeff_a - FLOAT** (默认值为 '-0.75')

    立方插值中使用的系数 ‘a’。两种常见的选择是 -0.5(在 TensorFlow 的某些情况下)和 -0.75(在 PyTorch 中)。详情请参阅 https://ieeexplore.ieee.org/document/1163711 中的公式 (4)。此属性仅在“mode”为“cubic”时有效。

  • **exclude_outside - INT** (默认值为 '0')

    如果设置为 1,则张量外部采样位置的权重将被设置为 0,并且权重将被重新归一化,使其总和为 1.0。默认值为 0。

  • **extrapolation_value - FLOAT** (默认值为 '0.0')

    当 coordinate_transformation_mode 为“tf_crop_and_resize”且 x_original 在范围 [0, length_original - 1] 之外时,此值用作对应的输出值。默认值为 0.0f。

  • **mode - STRING** (默认值为 'nearest')

    三种插值模式:nearest(默认)、linear 和 cubic。“linear”模式包括一维张量的线性插值和 N 维张量的 N 线性插值(例如,二维张量的双线性插值)。“cubic”模式包括一维张量的三次插值和 N 维张量的 N 次插值(例如,二维张量的双三次插值)。

  • **nearest_mode - STRING** (默认值为 'round_prefer_floor')

    四种模式:round_prefer_floor(默认,也称为向下舍入一半)、round_prefer_ceil(也称为向上舍入一半)、floor、ceil。仅用于最近邻插值。它表示如何从 x_original 获取输入张量中的“最近”像素,因此此属性仅在“mode”为“nearest”时有效。

输入

1 到 4 个输入。

  • **X** (异构) - **T1**

    N 维张量

  • **roi** (可选,异构) - **T2**

    给定为 [start1, …, startN, end1, …, endN] 的一维张量,其中 N 是 X 的秩。RoI 的坐标在输入图像的坐标系中进行归一化。它仅在 coordinate_transformation_mode 为“tf_crop_and_resize”时生效。

  • **scales** (可选,异构) - **tensor(float)**

    沿每个维度的比例数组。其值大于 0。如果小于 1,则为下采样,否则为上采样。‘scales’ 的元素数量应与输入‘X’的秩相同。必须指定‘scales’和‘sizes’之一,如果两者都指定则会出错。如果需要‘sizes’,用户可以在此算子的输入列表中使用空字符串作为‘scales’的名称。

  • **sizes** (可选,异构) - **tensor(int64)**

    输出张量的大小。‘sizes’ 的元素数量应与输入‘X’的秩相同。只能指定‘scales’和‘sizes’中的一个。

输出

  • **Y** (异构) - **T1**

    调整大小后的 N 维张量

类型约束

  • **T1** in ( tensor(bfloat16), tensor(bool), tensor(complex128), tensor(complex64), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) )

    将输入‘X’和输出‘Y’约束为所有张量类型。

  • **T2** in ( tensor(double), tensor(float), tensor(float16) )

    将 roi 类型约束为 float 或 double。

Resize - 11

版本

  • 名称: Resize (GitHub)

  • : main

  • **起始版本**: 11

  • 函数: False

  • 支持级别: SupportType.COMMON

  • Shape 推理: True

此版本的算子已可用,**自版本 11 起**。

摘要

调整输入张量的大小。通常,它将输出张量中的每个值计算为输入张量中邻域(也称为采样位置)的加权平均值。如果未指定输入“sizes”,则输出张量的每个维度值是:output_dimension = floor(input_dimension * (roi_end - roi_start) * scale)。

属性

  • **coordinate_transformation_mode - STRING** (默认值为 'half_pixel')

    此属性描述了如何将调整大小后的张量中的坐标转换为原始张量中的坐标。

    每个维度的坐标都单独进行转换。让我们以轴 x 为例进行描述。将 x_resized 表示为调整大小后的张量中轴 x 的坐标,x_original 表示为原始张量中轴 x 的坐标,length_original 表示为原始张量在轴 x 上的长度,length_resized 表示为调整大小后的张量在轴 x 上的长度,roi_x = (start_x, end_x) 表示输入“roi”中轴 x 的范围,scale = length_resized / length_original,

    if coordinate_transformation_mode is “half_pixel”,
    x_original = (x_resized + 0.5) / scale - 0.5,

    if coordinate_transformation_mode is “pytorch_half_pixel”,
    x_original = length_resized > 1 ? (x_resized + 0.5) / scale - 0.5 : 0,

    if coordinate_transformation_mode is “align_corners”,
    x_original = x_resized * (length_original - 1) / (length_resized - 1),

    if coordinate_transformation_mode is “asymmetric”,
    x_original = x_resized / scale,

    if coordinate_transformation_mode is “tf_half_pixel_for_nn”,
    x_original = (x_resized + 0.5) / scale,

    if coordinate_transformation_mode is “tf_crop_and_resize”,
    x_original = length_resized > 1 ? start_x * (length_original - 1) + x_resized * (end_x - start_x) * (length_original - 1) / (length_resized - 1) : 0.5 * (start_x + end_x) * (length_original - 1)。

  • **cubic_coeff_a - FLOAT** (默认值为 '-0.75')

    立方插值中使用的系数 ‘a’。两种常见的选择是 -0.5(在 TensorFlow 的某些情况下)和 -0.75(在 PyTorch 中)。详情请参阅 https://ieeexplore.ieee.org/document/1163711 中的公式 (4)。此属性仅在“mode”为“cubic”时有效。

  • **exclude_outside - INT** (默认值为 '0')

    如果设置为 1,则张量外部采样位置的权重将被设置为 0,并且权重将被重新归一化,使其总和为 1.0。默认值为 0。

  • **extrapolation_value - FLOAT** (默认值为 '0.0')

    当 coordinate_transformation_mode 为“tf_crop_and_resize”且 x_original 在范围 [0, length_original - 1] 之外时,此值用作对应的输出值。默认值为 0.0f。

  • **mode - STRING** (默认值为 'nearest')

    三种插值模式:nearest(默认)、linear 和 cubic。“linear”模式包括一维张量的线性插值和 N 维张量的 N 线性插值(例如,二维张量的双线性插值)。“cubic”模式包括一维张量的三次插值和 N 维张量的 N 次插值(例如,二维张量的双三次插值)。

  • **nearest_mode - STRING** (默认值为 'round_prefer_floor')

    四种模式:round_prefer_floor(默认,也称为向下舍入一半)、round_prefer_ceil(也称为向上舍入一半)、floor、ceil。仅用于最近邻插值。它表示如何从 x_original 获取输入张量中的“最近”像素,因此此属性仅在“mode”为“nearest”时有效。

输入

3 到 4 个输入。

  • **X** (异构) - **T1**

    N 维张量

  • **roi** (异构) - **T2**

    给定为 [start1, …, startN, end1, …, endN] 的一维张量,其中 N 是 X 的秩。RoI 的坐标在输入图像的坐标系中进行归一化。它仅在 coordinate_transformation_mode 为“tf_crop_and_resize”时生效。

  • **scales** (异构) - **tensor(float)**

    沿每个维度的比例数组。其值大于 0。如果小于 1,则为下采样,否则为上采样。‘scales’ 的元素数量应与输入‘X’的秩相同。如果需要‘size’,用户必须将‘scales’设置为空张量。

  • **sizes** (可选,异构) - **tensor(int64)**

    输出张量的大小。‘sizes’ 的元素数量应与输入‘X’的秩相同。只有在‘scales’设置为空张量时才能设置。

输出

  • **Y** (异构) - **T1**

    调整大小后的 N 维张量

类型约束

  • **T1** in ( tensor(bool), tensor(complex128), tensor(complex64), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) )

    将输入‘X’和输出‘Y’约束为所有张量类型。

  • **T2** in ( tensor(double), tensor(float), tensor(float16) )

    将 roi 类型约束为 float 或 double。

Resize - 10

版本

  • 名称: Resize (GitHub)

  • : main

  • **起始版本**: 10

  • 函数: False

  • 支持级别: SupportType.COMMON

  • Shape 推理: True

此版本的算子已可用,**自版本 10 起**。

摘要

调整输入张量的大小。输出张量的每个维度值是:output_dimension = floor(input_dimension * scale)。

属性

  • **mode - STRING** (默认值为 'nearest')

    两种插值模式:nearest(默认)和 linear(包括双线性、三线性等)

输入

  • **X** (异构) - **T**

    N 维张量

  • **scales** (异构) - **tensor(float)**

    沿每个维度的比例数组。其值大于 0。如果小于 1,则为下采样,否则为上采样。‘scales’ 的元素数量应与输入‘X’的秩相同。

输出

  • **Y** (异构) - **T**

    调整大小后的 N 维张量

类型约束

  • **T** in ( tensor(bool), tensor(complex128), tensor(complex64), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) )

    将输入‘X’和输出‘Y’约束为所有张量类型。