bgawrych commented on a change in pull request #20621:
URL: https://github.com/apache/incubator-mxnet/pull/20621#discussion_r745458419
##########
File path: src/operator/nn/dnnl/dnnl_concat-inl.h
##########
@@ -52,13 +52,18 @@ class DNNLConcatFwd {
static DNNLConcatFwd& GetConcatForward(int concat_dim,
const std::vector<NDArray>& in_data,
- const std::vector<dnnl::memory::desc>&
data_md) {
+ const std::vector<dnnl::memory::desc>&
data_md,
+ int cache_dim = -1) {
#if DMLC_CXX11_THREAD_LOCAL
static thread_local std::unordered_map<OpSignature, DNNLConcatFwd, OpHash>
fwds;
#else
static MX_THREAD_LOCAL std::unordered_map<OpSignature, DNNLConcatFwd,
OpHash> fwds;
#endif
+ if (cache_dim == -1) {
+ cache_dim = concat_dim;
Review comment:
Changed to adding -1 value to key. It's necessary for stack op as there
is used trick creating always 3 dimensional memory descriptor [leading_dim,
mid_dim, trailing_dim]. For the same input shapes stack op can be performed on
different axis. Without adding new key returned primitive would be the same for
both scenarios which is wrong.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]