Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redundant comparison in SoftmaxLayer<Dtype>::Forward_cpu #6597

Open
csukuangfj opened this issue Nov 4, 2018 · 0 comments
Open

Redundant comparison in SoftmaxLayer<Dtype>::Forward_cpu #6597

csukuangfj opened this issue Nov 4, 2018 · 0 comments

Comments

@csukuangfj
Copy link
Contributor

Issue summary

See the code below from the master branch

    // initialize scale_data to the first plane
    caffe_copy(inner_num_, bottom_data + i * dim, scale_data);
    for (int j = 0; j < channels; j++) {
      for (int k = 0; k < inner_num_; k++) {
        scale_data[k] = std::max(scale_data[k],
            bottom_data[i * dim + j * inner_num_ + k]);
      }
    }

j should start from 1. It is useless to set j=0 to compare scale_data[k] against itself.

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 a pull request may close this issue.

1 participant