Skip to content

Conversation

@zsdonghao
Copy link
Member

@zsdonghao zsdonghao commented Feb 23, 2018

  • fixed all unused code
  • fixed all error prone
  • fixed most of the code style

@tensorlayer tensorlayer deleted a comment Feb 23, 2018
@tensorlayer tensorlayer deleted a comment Feb 23, 2018

def conv_layers_simple_api(net_in):
with tf.name_scope('preprocess') as scope:
with tf.name_scope('preprocess'): # as scope:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove # as scope


def conv_layers_simple_api(net_in):
with tf.name_scope('preprocess') as scope:
with tf.name_scope('preprocess'): # as scope:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this comment as users may compensate as a description.

logging.info("EmbeddingInputlayer %s: (%d, %d)" % (self.name, vocabulary_size, embedding_size))

with tf.variable_scope(name) as vs:
with tf.variable_scope(name): # as vs:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove comment


logging.info("TileLayer %s: multiples:%s" % (self.name, multiples))
with tf.variable_scope(name) as vs:
with tf.variable_scope(name): # as vs:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove comment

for l in layers[1:]:
assert str(self.outputs.get_shape()) == str(
l.outputs.get_shape()), "Hint: the input shapes should be the same. %s != %s" % (self.outputs.get_shape(), str(l.outputs.get_shape()))
# assert str(self.outputs.get_shape()) == str(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove comment

outputs = tf.concat(2, outputs)
if return_last:
# [batch_size, 2 * n_hidden]
raise Exception("Do not support return_last at the moment")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shall we actually remove this parameter from the interface?

"""
inputs = layer.outputs
with tf.variable_scope(name) as vs:
with tf.variable_scope(name): # as vs:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove comment

net_new = Layer(inputs, name=whole_name)
# with tf.name_scope(name):
with tf.variable_scope(name) as vs:
with tf.variable_scope(name): # as vs:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove comment

for i in range(len(annotations)):
class_list.append(annotations[i][0])
bbox_list.append(annotations[i][1:])
# for i in range(len(annotations)):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove comments

elif _platform == "win32":
logging.info(text2 + "Windows")
# TODO
raise NotImplementedError()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to add a string telling "this function is not supported on the Windows platform"

elif _platform == "win32":
logging.info('Windows%s' % text2)
# TODO
raise NotImplementedError()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the same as above

@tensorlayer tensorlayer deleted a comment Feb 23, 2018
"""
y = []
[y.append(i) for i in x if not i in y]
# [y.append(i) for i in x if not i in y]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the comment

@tensorlayer tensorlayer deleted a comment Feb 23, 2018
@zsdonghao zsdonghao changed the title fix unused code fixed unused code, error prone and code style Feb 23, 2018
output_keep_prob=out_keep_prob if is_last else 1.0) # out_keep_prob)
else:
cell_creator = lambda: rnn_creator()
# cell_creator = lambda: rnn_creator()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove comment

# assert batch_size % num_skips == 0
if batch_size % num_skips != 0:
raise Exception("batch_size should be able to be divided by num_skips.")
# assert num_skips <= 2 * skip_window
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

assert batch_size % num_skips == 0
assert num_skips <= 2 * skip_window

# assert batch_size % num_skips == 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

logging.info('Limited vocabulary size {}'.format(vocabulary_size))
assert len(collections.Counter(words).keys()) >= vocabulary_size, \
"the limited vocabulary_size must be less than or equal to the read vocabulary_size"
# assert len(collections.Counter(words).keys()) >= vocabulary_size, \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

@tensorlayer tensorlayer deleted a comment Feb 23, 2018
@tensorlayer tensorlayer deleted a comment Feb 23, 2018
@luomai luomai merged commit 88d2396 into master Feb 23, 2018
@luomai luomai deleted the unused-code branch February 23, 2018 15:36
luomai pushed a commit that referenced this pull request Nov 21, 2018
* raise not implemented error instead of pass

* fix unused code

* fix pylint issues.

* fixed some assert error

* fixed unused code

* fixed all error prone

* fixed most of the code style

* yapf

* yapf tests

* fixed suggestion

* yapf

* remove unused code

* remove unused code

* fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants