美文网首页
[tf]tensor = tf.to_int32(tensor)

[tf]tensor = tf.to_int32(tensor)

作者: VanJordan | 来源:发表于2019-02-06 09:52 被阅读1次
        # tf.Example only supports tf.int64, but the TPU only supports tf.int32.
        # So cast all int64 to int32.
        for name in list(example.keys()):
          t = example[name]
          if t.dtype == tf.int64:
            t = tf.to_int32(t)
          example[name] = t
    

    相关文章

      网友评论

          本文标题:[tf]tensor = tf.to_int32(tensor)

          本文链接:https://www.haomeiwen.com/subject/hdibsqtx.html