mindspore/docs/api/api_python/ops/mindspore.ops.AffineGrid.rst

22 lines
1.2 KiB
ReStructuredText
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mindspore.ops.AffineGrid
========================
.. py:class:: mindspore.ops.AffineGrid(align_corners=False)
基于一批仿射矩阵 theta 生成一个2D 或 3D 的流场(采样网格)。
.. warning::
这是一个实验性API后续可能修改或删除。
更多参考详见 :func:`mindspore.ops.affine_grid`
参数:
- **align_corners** (bool可选) - 在几何上,我们将输入的像素视为正方形而不是点。如果设置为 ``True`` ,则极值 -1 和 1 指输入像素的中心。如果设置为 ``False`` ,则极值 -1 和 1 指输入像素的边角,从而使采样与分辨率无关。默认值: ``False``
输入:
- **theta** (Tensor) - 仿射矩阵输入数据类型为float16和float32。当输入为2D grid时其shape为 :math:`(N, 2, 3)` 当输入为3D grid时其shape为 :math:`(N, 3, 4)`
- **output_size** (tuple[int]) - 目标输出图像大小。指格式为 :math:`(N, C, H, W)` 的2D grid或格式为 :math:`(N, C, D, H, W)` 的3D grid的大小。
输出:
Tensor其数据类型与 `theta` 相同当输入为2D grid时其shape为 :math:`(N, H, W, 2)` 当输入为3D grid时其shape为 :math:`(N, D, H, W, 3)`