Skip to content

Commit

Permalink
[Fix] Upgrade for tensorflow 1.0 with tf_upgrade.py
Browse files Browse the repository at this point in the history
  • Loading branch information
efeiefei committed Feb 27, 2017
1 parent 5eb2183 commit b3df4da
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions dense_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,8 @@ def inference(inputs, is_train=True):
sparse_labels = tf.reshape(batch_labels, [-1, 1])
derived_size = tf.shape(batch_labels)[0]
indices = tf.reshape(tf.range(0, derived_size, 1), [-1, 1])
concated = tf.concat(concat_dim=1, values=[indices, sparse_labels])
outshape = tf.pack([derived_size, LABEL_SIZE])
concated = tf.concat(axis=1, values=[indices, sparse_labels])
outshape = tf.stack([derived_size, LABEL_SIZE])
new_batch_labels = tf.sparse_to_dense(concated, outshape, 1.0, 0.0)
_, train_auc = tf.contrib.metrics.streaming_auc(train_softmax,
new_batch_labels)
Expand All @@ -343,8 +343,8 @@ def inference(inputs, is_train=True):
sparse_labels = tf.reshape(validate_batch_labels, [-1, 1])
derived_size = tf.shape(validate_batch_labels)[0]
indices = tf.reshape(tf.range(0, derived_size, 1), [-1, 1])
concated = tf.concat(concat_dim=1, values=[indices, sparse_labels])
outshape = tf.pack([derived_size, LABEL_SIZE])
concated = tf.concat(axis=1, values=[indices, sparse_labels])
outshape = tf.stack([derived_size, LABEL_SIZE])
new_validate_batch_labels = tf.sparse_to_dense(concated, outshape, 1.0, 0.0)
_, validate_auc = tf.contrib.metrics.streaming_auc(validate_softmax,
new_validate_batch_labels)
Expand Down
8 changes: 4 additions & 4 deletions sparse_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,8 @@ def inference(sparse_ids, sparse_values, is_train=True):
sparse_labels = tf.reshape(batch_labels, [-1, 1])
derived_size = tf.shape(batch_labels)[0]
indices = tf.reshape(tf.range(0, derived_size, 1), [-1, 1])
concated = tf.concat(concat_dim=1, values=[indices, sparse_labels])
outshape = tf.pack([derived_size, LABEL_SIZE])
concated = tf.concat(axis=1, values=[indices, sparse_labels])
outshape = tf.stack([derived_size, LABEL_SIZE])
new_train_batch_labels = tf.sparse_to_dense(concated, outshape, 1.0, 0.0)
_, train_auc = tf.contrib.metrics.streaming_auc(train_softmax,
new_train_batch_labels)
Expand All @@ -302,8 +302,8 @@ def inference(sparse_ids, sparse_values, is_train=True):
sparse_labels = tf.reshape(validate_batch_labels, [-1, 1])
derived_size = tf.shape(validate_batch_labels)[0]
indices = tf.reshape(tf.range(0, derived_size, 1), [-1, 1])
concated = tf.concat(concat_dim=1, values=[indices, sparse_labels])
outshape = tf.pack([derived_size, LABEL_SIZE])
concated = tf.concat(axis=1, values=[indices, sparse_labels])
outshape = tf.stack([derived_size, LABEL_SIZE])
new_validate_batch_labels = tf.sparse_to_dense(concated, outshape, 1.0, 0.0)
_, validate_auc = tf.contrib.metrics.streaming_auc(validate_softmax,
new_validate_batch_labels)
Expand Down

0 comments on commit b3df4da

Please sign in to comment.