effects.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:py-noisemaker 作者: aayars 项目源码 文件源码
def row_index(shape):
    """
    Generate an X index for the given tensor.

    .. code-block:: python

      [
        [ 0, 1, 2, ... width-1 ],
        [ 0, 1, 2, ... width-1 ],
        ... (x height)
      ]

    :param list[int] shape:
    :return: Tensor
    """

    height = shape[0]
    width = shape[1]

    row_identity = tf.cumsum(tf.ones([width], dtype=tf.int32), exclusive=True)
    row_identity = tf.reshape(tf.tile(row_identity, [height]), [height, width])

    return row_identity
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号