Utilities.py 文件源码

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

项目:Adversarial-Neural-Cryptography 作者: msokoloff1 项目源码 文件源码
def ensureRank3(input):
    """Ensures the input tensor has a rank of 3, otherwise it reshapes the tensor"""
    if (len(input.get_shape()) == 2):
        input = tf.expand_dims(input, 2)
    tf.assert_rank(input, 3, message="Tensor is not rank 3")
    return input
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号