2.4K Star 8.2K Fork 4.4K

GVPMindSpore / mindspore

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
mindspore.nn.TimeDistributed.rst 1.06 KB
一键复制 编辑 原始数据 按行查看 历史
luojianing 提交于 2023-05-18 13:04 . add ` for values

mindspore.nn.TimeDistributed

.. py:class:: mindspore.nn.TimeDistributed(layer, time_axis, reshape_with_axis=None)

    时间序列封装层。

    TimeDistributed是一个封装层,它允许将一个网络层应用到输入的每个时间切片。 `x` 至少是三维。执行中有两种情况。当提供 `reshape_with_axis` 时,选择reshape方法会更高效;否则,将使用沿 `time_axis` 划分输入的方法,这种方法更通用。比如,在处理BN时无法提供 `reshape_with_axis` 。

    参数:
        - **layer** (Union[Cell, Primitive]) - 需被封装的Cell或Primitive。
        - **time_axis** (int) - 指定各个时间切片上的轴。
        - **reshape_with_axis** (int) - 将使用 `time_axis` 调整该轴。默认值: ``None`` 。

    输入:
        - **x** (Tensor) - shape为 :math:`(N, T, *)` 的Tensor。其中 :math:`*` 表示任意数量的附加维度。

    输出:
        shape为 :math:`(N, T, *)` 的Tensor。

    异常:
        - **TypeError** - layer不是Cell或Primitive类型。
Python
1
https://gitee.com/mindspore/mindspore.git
git@gitee.com:mindspore/mindspore.git
mindspore
mindspore
mindspore
r2.3

搜索帮助