base.py 文件源码

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

项目:odin 作者: imito 项目源码 文件源码
def _check_dtype(dtype):
  if hasattr(dtype, '__call__'):
    return functionable(dtype)
  # ====== check dtype ====== #
  if dtype is None:
    dtype = K.floatX
  elif isinstance(dtype, np.dtype) or is_string(dtype):
    dtype = str(dtype)
  elif isinstance(dtype, VariableDesc):
    dtype = dtype.dtype
  elif isinstance(dtype, tf.DType):
    dtype = dtype.base_dtype.name
  return dtype
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号