-
Notifications
You must be signed in to change notification settings - Fork 6.8k
If variable is not used within the loop body, start the name with an underscore #20505
If variable is not used within the loop body, start the name with an underscore #20505
Conversation
…intended, start the name with an underscore
Hey @mozga-intel , Thanks for submitting the PR
CI supported jobs: [unix-gpu, clang, windows-cpu, unix-cpu, miscellaneous, sanity, centos-cpu, centos-gpu, windows-gpu, edge, website] Note: |
@szha Could you help: Please have a look at the test: test. There is an axis param that is set up in a loop: [loop] Loop control variable 'axis' not used within the loop body but it's only used out of the loop scope: loop for axis in range(-data_ndim, data_ndim):
data_shape = ()
for _ in range(data_ndim):
data_shape += (np.random.randint(low=1, high=5), )
idx_shape = ()
for _ in range(idx_ndim):
idx_shape += (np.random.randint(low=1, high=5), )
....
result = mx.sym.take(a=data, indices=idx, axis=axis, mode=mode) The axis is always equal to Could you please tell whether the lines L4191 to L4231 shouldn't be placed in the loop scope to get a changeable axis? |
@mxnet-bot run ci [website] |
Jenkins CI successfully triggered : [website] |
@mxnet-bot run ci [centos-gpu] |
@mxnet-bot run ci [centos-gpu, unix-gpu] |
Jenkins CI successfully triggered : [unix-gpu, centos-gpu] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix. A few loops can be updated to be more clear.
Description
Loop control variable 'x' is not used within the loop body. If this is intended, start the name with an underscore.
Checklist
Essentials
Changes
Comments