2.4K Star 8.2K Fork 4.4K

GVPMindSpore / mindspore

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
mindspore.nn.ReflectionPad1d.rst 1.01 KB
一键复制 编辑 原始数据 按行查看 历史
宦晓玲 提交于 2024-03-20 16:33 . modify the inconsistence in files 2.3

mindspore.nn.ReflectionPad1d

.. py:class:: mindspore.nn.ReflectionPad1d(padding)

    根据 `padding` 对输入 `x` 进行填充。

    参数:
        - **padding** (union[int, tuple]) - 填充大小,如果输入为int,则对所有边界进行相同大小的填充;如果是tuple,则为 :math:`(pad\_left, pad\_right)`。

    输入:
        - **x** (Tensor) - 输入Tensor,2D或3D。shape为 :math:`(C, W_{in})` 或 :math:`(N, C, W_{in})` 。

    输出:
        Tensor,填充后的Tensor, shape为 :math:`(C, W_{out})` 或 :math:`(N, C, W_{out})` 。其中 :math:`W_{out} = W_{in} + pad\_left + pad\_right` 。

    异常:
        - **TypeError** - `padding` 不是tuple或int。
        - **TypeError** - `padding` 中存在不是int的元素。
        - **ValueError** - `padding` 是tuple,且长度不能被2整除。
        - **ValueError** - `padding` 是tuple,且存在负数。
        - **ValueError** - `padding` 是tuple,且长度和tensor的维度不匹配。
Python
1
https://gitee.com/mindspore/mindspore.git
git@gitee.com:mindspore/mindspore.git
mindspore
mindspore
mindspore
r2.3

搜索帮助