utils.py 文件源码

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

项目:spark-deep-learning 作者: databricks 项目源码 文件源码
def get_shape(tfobj_or_name, graph):
    """
    Return the shape of the tensor as a list

    :param graph: tf.Graph, a TensorFlow Graph object
    :param tfobj_or_name: either a tf.Tensor, tf.Operation or a name to either
    """
    graph = validated_graph(graph)
    _shape = get_tensor(tfobj_or_name, graph).get_shape().as_list()
    return [-1 if x is None else x for x in _shape]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号