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

Extra memory allocated in SoftMaxLayer #6596

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

Extra memory allocated in SoftMaxLayer #6596

csukuangfj opened this issue Nov 4, 2018 · 0 comments

Comments

@csukuangfj
Copy link
Contributor

Issue summary

Extra memory is allocated for scale_ in SoftmaxLayer.

Steps to reproduce

See the code below

  outer_num_ = bottom[0]->count(0, softmax_axis_);
  inner_num_ = bottom[0]->count(softmax_axis_ + 1);
  vector<int> scale_dims = bottom[0]->shape();
  scale_dims[softmax_axis_] = 1;
  scale_.Reshape(scale_dims);

scale_ only needs inner_num_ of bytes, but outer_num_*inner_num_ of bytes are allocated.

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