|
|
@ -15,9 +15,6 @@ limitations under the License. */
|
|
|
|
#include "paddle/fluid/operators/data_norm_op.h"
|
|
|
|
#include "paddle/fluid/operators/data_norm_op.h"
|
|
|
|
#include <string>
|
|
|
|
#include <string>
|
|
|
|
#include "paddle/fluid/framework/data_layout.h"
|
|
|
|
#include "paddle/fluid/framework/data_layout.h"
|
|
|
|
#ifdef PADDLE_WITH_MKLDNN
|
|
|
|
|
|
|
|
#include "paddle/fluid/platform/mkldnn_helper.h"
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace paddle {
|
|
|
|
namespace paddle {
|
|
|
|
namespace operators {
|
|
|
|
namespace operators {
|
|
|
@ -97,13 +94,6 @@ class DataNormOp : public framework::OperatorWithKernel {
|
|
|
|
// TODO(pzelazko-intel): enable MKLDNN layout when it's ready
|
|
|
|
// TODO(pzelazko-intel): enable MKLDNN layout when it's ready
|
|
|
|
framework::LibraryType library = framework::LibraryType::kPlain;
|
|
|
|
framework::LibraryType library = framework::LibraryType::kPlain;
|
|
|
|
framework::DataLayout layout = framework::DataLayout::kAnyLayout;
|
|
|
|
framework::DataLayout layout = framework::DataLayout::kAnyLayout;
|
|
|
|
#ifdef PADDLE_WITH_MKLDNN
|
|
|
|
|
|
|
|
if (library == framework::LibraryType::kPlain &&
|
|
|
|
|
|
|
|
platform::CanMKLDNNBeUsed(ctx)) {
|
|
|
|
|
|
|
|
library = framework::LibraryType::kMKLDNN;
|
|
|
|
|
|
|
|
layout = framework::DataLayout::kMKLDNN;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return framework::OpKernelType(input_data_type, ctx.GetPlace(), layout,
|
|
|
|
return framework::OpKernelType(input_data_type, ctx.GetPlace(), layout,
|
|
|
|
library);
|
|
|
|
library);
|
|
|
@ -140,9 +130,6 @@ class DataNormOpMaker : public framework::OpProtoAndCheckerMaker {
|
|
|
|
"Scales of the history data batch, "
|
|
|
|
"Scales of the history data batch, "
|
|
|
|
"will apply to output when training")
|
|
|
|
"will apply to output when training")
|
|
|
|
.AsIntermediate();
|
|
|
|
.AsIntermediate();
|
|
|
|
AddAttr<bool>("use_mkldnn",
|
|
|
|
|
|
|
|
"(bool, default false) Only used in mkldnn kernel")
|
|
|
|
|
|
|
|
.SetDefault(false);
|
|
|
|
|
|
|
|
AddComment(R"DOC(
|
|
|
|
AddComment(R"DOC(
|
|
|
|
Data Normalization.
|
|
|
|
Data Normalization.
|
|
|
|
|
|
|
|
|
|
|
@ -264,14 +251,6 @@ class DataNormGradOp : public framework::OperatorWithKernel {
|
|
|
|
framework::LibraryType library = framework::LibraryType::kPlain;
|
|
|
|
framework::LibraryType library = framework::LibraryType::kPlain;
|
|
|
|
framework::DataLayout layout = framework::DataLayout::kAnyLayout;
|
|
|
|
framework::DataLayout layout = framework::DataLayout::kAnyLayout;
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef PADDLE_WITH_MKLDNN
|
|
|
|
|
|
|
|
if (library == framework::LibraryType::kPlain &&
|
|
|
|
|
|
|
|
platform::CanMKLDNNBeUsed(ctx)) {
|
|
|
|
|
|
|
|
library = framework::LibraryType::kMKLDNN;
|
|
|
|
|
|
|
|
layout = framework::DataLayout::kMKLDNN;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return framework::OpKernelType(ctx.Input<Tensor>("X")->type(),
|
|
|
|
return framework::OpKernelType(ctx.Input<Tensor>("X")->type(),
|
|
|
|
ctx.GetPlace(), layout, library);
|
|
|
|
ctx.GetPlace(), layout, library);
|
|
|
|
}
|
|
|
|
}
|
|
|
|