Skip to content

Commit 30d3203

Browse files
committed
Withdraw mkldnn mul
1 parent 654f5d3 commit 30d3203

File tree

6 files changed

+8
-308
lines changed

6 files changed

+8
-308
lines changed

paddle/fluid/operators/mul_mkldnn_op.cc

Lines changed: 0 additions & 197 deletions
This file was deleted.

paddle/fluid/operators/mul_op.cc

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ limitations under the License. */
1616
#include <string>
1717
#include <vector>
1818

19-
#ifdef PADDLE_WITH_MKLDNN
20-
#include "paddle/fluid/platform/mkldnn_helper.h"
21-
#endif
22-
2319
namespace paddle {
2420
namespace operators {
2521

@@ -76,22 +72,6 @@ class MulOp : public framework::OperatorWithKernel {
7672
ctx->SetOutputDim("Out", framework::make_ddim(output_dims));
7773
ctx->ShareLoD("X", /*->*/ "Out");
7874
}
79-
80-
private:
81-
framework::OpKernelType GetExpectedKernelType(
82-
const framework::ExecutionContext& ctx) const override {
83-
framework::LibraryType library{framework::LibraryType::kPlain};
84-
#ifdef PADDLE_WITH_MKLDNN
85-
if (library == framework::LibraryType::kPlain &&
86-
platform::CanMKLDNNBeUsed(ctx)) {
87-
library = framework::LibraryType::kMKLDNN;
88-
}
89-
#endif
90-
framework::DataLayout layout{framework::DataLayout::kAnyLayout};
91-
return framework::OpKernelType(
92-
framework::ToDataType(ctx.Input<Tensor>("X")->type()), ctx.GetPlace(),
93-
layout, library);
94-
}
9575
};
9676

9777
class MulOpMaker : public framework::OpProtoAndCheckerMaker {
@@ -120,9 +100,6 @@ class MulOpMaker : public framework::OpProtoAndCheckerMaker {
120100
)DOC")
121101
.SetDefault(1)
122102
.EqualGreaterThan(1);
123-
AddAttr<bool>("use_mkldnn",
124-
"(bool, default false) Only used in mkldnn kernel")
125-
.SetDefault(false);
126103
AddAttr<int>(
127104
"y_num_col_dims",
128105
R"DOC((int, default 1), The mul_op can take tensors with more than two,
@@ -177,22 +154,6 @@ class MulGradOp : public framework::OperatorWithKernel {
177154
ctx->SetOutputDim(y_grad_name, y_dims);
178155
}
179156
}
180-
181-
private:
182-
framework::OpKernelType GetExpectedKernelType(
183-
const framework::ExecutionContext& ctx) const override {
184-
framework::LibraryType library{framework::LibraryType::kPlain};
185-
#ifdef PADDLE_WITH_MKLDNN
186-
if (library == framework::LibraryType::kPlain &&
187-
platform::CanMKLDNNBeUsed(ctx)) {
188-
library = framework::LibraryType::kMKLDNN;
189-
}
190-
#endif
191-
framework::DataLayout layout{framework::DataLayout::kAnyLayout};
192-
return framework::OpKernelType(
193-
framework::ToDataType(ctx.Input<Tensor>("X")->type()), ctx.GetPlace(),
194-
layout, library);
195-
}
196157
};
197158

198159
} // namespace operators

python/paddle/fluid/layers/nn.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,8 @@ def fc(input,
177177
inputs={"X": input_var,
178178
"Y": w},
179179
outputs={"Out": tmp},
180-
attrs={
181-
"x_num_col_dims": num_flatten_dims,
182-
"y_num_col_dims": 1,
183-
"use_mkldnn": use_mkldnn
184-
})
180+
attrs={"x_num_col_dims": num_flatten_dims,
181+
"y_num_col_dims": 1})
185182
mul_results.append(tmp)
186183

187184
if len(mul_results) == 1:
@@ -3929,10 +3926,10 @@ def upsampling_bilinear2d(input, out_shape=None, scale=None, name=None):
39293926
Bilinear interpolation is an extension of linear interpolation for
39303927
interpolating functions of two variables (e.g. H-direction and
39313928
W-direction in this layer) on a rectilinear 2D grid.
3932-
3929+
39333930
For details, please refer to Wikipedia:
39343931
https://en.wikipedia.org/wiki/Bilinear_interpolation
3935-
3932+
39363933
Args:
39373934
input (Variable): The input tensor of bilinear interpolation,
39383935
This is a 4-D tensor of the shape
@@ -3950,7 +3947,7 @@ def upsampling_bilinear2d(input, out_shape=None, scale=None, name=None):
39503947
Returns:
39513948
out (Variable): The output is a 4-D tensor of the shape
39523949
(num_batches, channls, out_h, out_w).
3953-
3950+
39543951
Examples:
39553952
.. code-block:: python
39563953

python/paddle/fluid/tests/unittests/test_mul_mkldnn_op.py

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)