Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
only reorder if mkldnn
Browse files Browse the repository at this point in the history
  • Loading branch information
azai91 committed Aug 7, 2018
1 parent c0e639a commit ec1d179
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/operator/nn/mkldnn/mkldnn_base-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,12 @@ static inline void InvalidateOutputs(const std::vector<NDArray> &arrs,

static inline std::vector<NDArray> CreateDefaultInputs(const std::vector<NDArray> &arrs) {
std::vector<NDArray> buffer(arrs.size());
for (size_t i = 0; i < arrs.size(); ++i)
buffer[i] = arrs[i].Reorder2Default();
for (size_t i = 0; i < arrs.size(); ++i) {
if (arrs[i].IsMKLDNNData()) {
buffer[i] = arrs[i].Reorder2Default();
}
buffer[i] = arrs[i];
}
return buffer;
}

Expand Down

0 comments on commit ec1d179

Please sign in to comment.