layers.py 文件源码

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

项目:tf_img_tech 作者: david-berthelot 项目源码 文件源码
def unboxn(vin, n):
    """vin = (batch, h, w, depth), returns vout = (batch, n*h, n*w, depth), each pixel is duplicated."""
    s = tf.shape(vin)
    vout = tf.concat(0, [vin] * (n ** 2))  # Poor man's replacement for tf.tile (required for Adversarial Training support).
    vout = tf.reshape(vout, [s[0] * (n ** 2), s[1], s[2], s[3]])
    vout = tf.batch_to_space(vout, [[0, 0], [0, 0]], n)
    return vout
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号