Skip to content

Commit aa2635f

Browse files
committed
clean code
1 parent cbf502e commit aa2635f

File tree

2 files changed

+1
-14
lines changed

2 files changed

+1
-14
lines changed

paddle/fluid/operators/load_op.cc

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
See the License for the specific language governing permissions and
1313
limitations under the License. */
1414
#include <fstream>
15-
#include <iostream>
1615

1716
#include "paddle/fluid/framework/data_type_transform.h"
1817
#include "paddle/fluid/framework/op_registry.h"
@@ -53,30 +52,22 @@ class LoadOp : public framework::OperatorBase {
5352
auto in_dtype = framework::ToDataType(tensor->type());
5453
auto out_dtype = load_as_fp16 ? framework::proto::VarType::FP16 : in_dtype;
5554

56-
std::cout << "In load op: " << std::endl;
57-
std::cout << "before conversion block" << std::endl;
58-
5955
if (in_dtype != out_dtype) {
6056
// convert to float16 tensor
6157
auto in_kernel_type = framework::OpKernelType(in_dtype, place);
6258
auto out_kernel_type = framework::OpKernelType(out_dtype, place);
6359
framework::LoDTensor fp16_tensor;
6460
// copy LoD info to the new tensor
6561
fp16_tensor.set_lod(tensor->lod());
66-
std::cout << "before TransDataType" << std::endl;
6762
framework::TransDataType(in_kernel_type, out_kernel_type, *tensor,
6863
&fp16_tensor);
69-
std::cout << "after TransDataType" << std::endl;
64+
7065
// reset output tensor
7166
out_var->Clear();
7267
tensor = out_var->GetMutable<framework::LoDTensor>();
7368
tensor->set_lod(fp16_tensor.lod());
74-
std::cout << "before TransDataType" << std::endl;
7569
tensor->ShareDataWith(fp16_tensor);
76-
std::cout << "after TransDataType" << std::endl;
7770
}
78-
79-
std::cout << "Out of load op: " << std::endl;
8071
}
8172
};
8273

paddle/fluid/operators/save_load_op_test.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,17 +127,13 @@ TEST(LoadFP16Op, CPU) {
127127
auto load_var = scope.Var("out_var");
128128
auto load_op = paddle::framework::OpRegistry::CreateOp(
129129
"load", {}, {{"Out", {"out_var"}}}, attrs);
130-
LOG(INFO) << "before load op run";
131130
load_op->Run(scope, place);
132-
LOG(INFO) << "after load op run";
133131

134132
auto target = load_var->Get<paddle::framework::LoDTensor>();
135133
paddle::platform::float16* actual = target.data<paddle::platform::float16>();
136-
LOG(INFO) << "after target->data";
137134
for (int64_t i = 0; i < tensor->numel(); ++i) {
138135
EXPECT_EQ(expect[i], static_cast<float>(actual[i]));
139136
}
140-
LOG(INFO) << "after expect equal";
141137

142138
auto& actual_lod = target.lod();
143139
EXPECT_EQ(expect_lod.size(), actual_lod.size());

0 commit comments

Comments
 (0)