重采样#

重采样前向#

重采样操作表示将图像的空间维度重采样到期望值。

输出数组包含两个张量

  • 重采样的输出张量。

  • 计算的索引张量。

注意

索引张量仅在最大池化的训练模式中输出。它可以馈送到后向传递以获得更快的性能。

重采样属性#

Resample_attributes 类用于配置重采样操作。它提供以下设置器

# The resampling mode, such as average pooling, max pooling, bi-linear, or cubic.
auto set_resampling_mode(ResampleMode_t const& value) -> Resample_attributes&;

# The padding mode, such as zero or neg infinity.
auto set_padding_mode(PaddingMode_t const& value) -> Resample_attributes&;

# The window size to be used for the resampling operation.
auto set_window(std::vector<int64_t> const& value) -> Resample_attributes&;
auto set_window(std::vector<cudnnFraction_t> const& value) -> Resample_attributes&;

# The stride values to be used for the resampling operation.
auto set_stride(std::vector<int64_t> const& value) -> Resample_attributes&;
auto set_stride(std::vector<cudnnFraction_t> const& value) -> Resample_attributes&;

# The padding values to be applied before and after the resampling input.
auto set_pre_padding(std::vector<int64_t> const& value) -> Resample_attributes&;
auto set_pre_padding(std::vector<cudnnFraction_t> const& value) -> Resample_attributes&;
auto set_post_padding(std::vector<int64_t> const& value) -> Resample_attributes&;
auto set_post_padding(std::vector<cudnnFraction_t> const& value) -> Resample_attributes&;

# A flag indicating whether the resampling is being performed during inference. 
auto set_is_inference(bool const value) -> Resample_attributes&;

有关不同版本中精确支持面的更多信息,请参阅前端开发者指南中的ResampleFwd

即将支持用于重采样前向的 Python API。

重采样后向#

即将支持。