tf-keras-skeleton.py 文件源码

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

项目:LIE 作者: EmbraceLife 项目源码 文件源码
def _to_tensor(x, dtype):
      """Convert the input `x` to a tensor of type `dtype`.

      Arguments:
          x: An object to be converted (numpy array, list, tensors).
          dtype: The destination type.

      Returns:
          A tensor.
      """
      x = ops.convert_to_tensor(x)
      if x.dtype != dtype:
        x = math_ops.cast(x, dtype)
      return x
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号