[tf]tensor = tf.to_int32(tensor)

2019-02-06  本文已影响1人  VanJordan
    # 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
上一篇 下一篇

猜你喜欢

热点阅读