Skip to content

Conversation

@zsdonghao
Copy link
Member

Motivation and Context

tensorlayer\files.py:1401: FutureWarning: elementwise != comparison failed and returning scalar instead; this will raise an error or perform elementwise comparison in the future.
  if annopoint != []:

head_x2s = anno['annorect']['x2'][0]
head_y2s = anno['annorect']['y2'][0]
for annopoint, head_x1, head_y1, head_x2, head_y2 in zip(annopoints, head_x1s, head_y1s, head_x2s, head_y2s):
if annopoint != []:
Copy link
Member

Choose a reason for hiding this comment

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

some python style guide suggests using implicit false,
e.g. https://google.github.io/styleguide/pyguide.html?showone=True/False_evaluations#True/False_evaluations
(I finally found one example.)

@luomai @DEKHTIARJonathan do you like implicit false?

Copy link
Member

Choose a reason for hiding this comment

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

LGTM as long as we can keep this consistent in our coding style.

Copy link
Member

Choose a reason for hiding this comment

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

I would defintely go toward the google coding guidelines. TL is an API on top of google product. In order to facilitate the learning curve, we should keep, to my mind, the same pratices whenever it is possible. I perfectly agree with @lgarithm

Copy link
Member

Choose a reason for hiding this comment

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

@zsdonghao could you change this line to implicit false? Namely if annopoint:

@zsdonghao zsdonghao merged commit 575f16f into master Apr 20, 2018
@zsdonghao zsdonghao deleted the fix-mpii-warning branch April 20, 2018 13:18
luomai pushed a commit that referenced this pull request Nov 21, 2018
* fix-mpii-warning

* google style
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.

6 participants