compat.py 文件源码

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

项目:tensorflow.cifar10 作者: yhlleo 项目源码 文件源码
def as_str_any(value):
  """Converts to `str` as `str(value)`, but use `as_str` for `bytes`.

  Args:
    value: A object that can be converted to `str`.

  Returns:
    A `str` object.
  """
  if isinstance(value, bytes):
    return as_str(value)
  else:
    return str(value)


# Numpy 1.8 scalars don't inherit from numbers.Integral in Python 3, so we
# need to check them specifically.  The same goes from Real and Complex.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号