diff options
author | 2016-12-02 11:45:06 -0800 | |
---|---|---|
committer | 2016-12-02 12:06:49 -0800 | |
commit | c8e1e5d818ac99d533ad75d2c9ef37c771ab8c48 (patch) | |
tree | a08f33209b0e22f0f33797d52e0af652e6f62733 /tensorflow/models/image | |
parent | 2324a5cf21bc58b41f71fcd460c697f7014d0e44 (diff) |
removing tf.slice as it is soon to be deprecated. replaced with tf.strided_slice in the following 15 files. more to come!
Change: 140875384
Diffstat (limited to 'tensorflow/models/image')
-rw-r--r-- | tensorflow/models/image/cifar10/cifar10_input.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tensorflow/models/image/cifar10/cifar10_input.py b/tensorflow/models/image/cifar10/cifar10_input.py index b00859b262..dbbd990402 100644 --- a/tensorflow/models/image/cifar10/cifar10_input.py +++ b/tensorflow/models/image/cifar10/cifar10_input.py @@ -84,12 +84,14 @@ def read_cifar10(filename_queue): # The first bytes represent the label, which we convert from uint8->int32. result.label = tf.cast( - tf.slice(record_bytes, [0], [label_bytes]), tf.int32) + tf.strided_slice(record_bytes, [0], [label_bytes]), tf.int32) # The remaining bytes after the label represent the image, which we reshape # from [depth * height * width] to [depth, height, width]. - depth_major = tf.reshape(tf.slice(record_bytes, [label_bytes], [image_bytes]), - [result.depth, result.height, result.width]) + depth_major = tf.reshape( + tf.strided_slice(record_bytes, [label_bytes], + [label_bytes + image_bytes]), + [result.depth, result.height, result.width]) # Convert from [depth, height, width] to [height, width, depth]. result.uint8image = tf.transpose(depth_major, [1, 2, 0]) |