|
@@ -18,15 +18,6 @@
|
|
|
|
|
|
import tensorflow as tf
|
|
import tensorflow as tf
|
|
|
|
|
|
-# backward compatible concat (arg order changed in head)
|
|
|
|
-import inspect
|
|
|
|
-def concat(values, axis):
|
|
|
|
- if 'axis' in inspect.signature(tf.concat).parameters.keys():
|
|
|
|
- return tf.concat(values=values, axis=axis)
|
|
|
|
- else:
|
|
|
|
- assert 'concat_dim' in inspect.signature(tf.concat).parameters.keys()
|
|
|
|
- return tf.concat(concat_dim=axis, values=values)
|
|
|
|
-
|
|
|
|
def build_input(dataset, data_path, batch_size, mode):
|
|
def build_input(dataset, data_path, batch_size, mode):
|
|
"""Build CIFAR image and labels.
|
|
"""Build CIFAR image and labels.
|
|
|
|
|
|
@@ -109,7 +100,7 @@ def build_input(dataset, data_path, batch_size, mode):
|
|
labels = tf.reshape(labels, [batch_size, 1])
|
|
labels = tf.reshape(labels, [batch_size, 1])
|
|
indices = tf.reshape(tf.range(0, batch_size, 1), [batch_size, 1])
|
|
indices = tf.reshape(tf.range(0, batch_size, 1), [batch_size, 1])
|
|
labels = tf.sparse_to_dense(
|
|
labels = tf.sparse_to_dense(
|
|
- tf.concat(values=[indices, labels], axis=1),
|
|
|
|
|
|
+ tf.concat_v2(values=[indices, labels], axis=1),
|
|
[batch_size, num_classes], 1.0, 0.0)
|
|
[batch_size, num_classes], 1.0, 0.0)
|
|
|
|
|
|
assert len(images.get_shape()) == 4
|
|
assert len(images.get_shape()) == 4
|