helper_routines.py 文件源码

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

项目:deepSpeech 作者: fordDeepDSP 项目源码 文件源码
def _variable_on_cpu(name, shape, initializer, use_fp16):
    """Helper to create a Variable stored on cpu memory.

    Args:
      name: name of the variable
      shape: list of ints
      initializer: initializer for Variable

    Returns:
      Variable Tensor
    """
    with tf.device('/cpu'):
        dtype = tf.float16 if use_fp16 else tf.float32
        var = tf.get_variable(name, shape,
                              initializer=initializer, dtype=dtype)
    return var
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号