plan.py 文件源码

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

项目:fold 作者: tensorflow 项目源码 文件源码
def _format_items(items):
  formatter = lambda x: '%.3e' % x
  last_large_output = None
  for key, value in items:
    value = np.asarray(value)
    large_output = value.ndim >= 1
    # If there was a previous output, print a separator.
    if last_large_output is not None:
      yield '\n' if large_output or last_large_output else ' '
    format_string = '%s:\n%s' if large_output else '%s: %s'
    yield format_string % (key,
                           np.array2string(value, style=formatter,
                                           formatter={'float_kind': formatter}))
    last_large_output = large_output
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号