Skip to content

Commit

Permalink
change tf.to_int32 to tf.cast (tensorflow#6359)
Browse files Browse the repository at this point in the history
tf.to_int32 raise deprecated warning.
change tf.to_int32(labels) to tf.cast(labels, tf.int32)
  • Loading branch information
tranvohuy authored and wlongxiang committed Apr 24, 2019
1 parent 7b20b36 commit 10b2c1b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion official/mnist/dataset.py
Expand Up @@ -97,7 +97,7 @@ def decode_image(image):
def decode_label(label):
label = tf.decode_raw(label, tf.uint8) # tf.string -> [tf.uint8]
label = tf.reshape(label, []) # label is a scalar
return tf.to_int32(label)
return tf.cast(label, tf.int32)

images = tf.data.FixedLengthRecordDataset(
images_file, 28 * 28, header_bytes=16).map(decode_image)
Expand Down

0 comments on commit 10b2c1b

Please sign in to comment.