utils.py 文件源码

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

项目:tensorstyle 作者: tonypeng 项目源码 文件源码
def tf_batch_gram_matrix(batch):
    _, height, width, channels = tensor_shape(batch)
    batch = tf.reshape(batch, (-1, height * width, channels))
    batch_T = tf.batch_matrix_transpose(batch)
    return tf.batch_matmul(batch_T, batch) / (height * width * channels)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号