Skip to content

Commit

Permalink
remove comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangxinglei committed Oct 22, 2024
1 parent 4d44aa1 commit 1430dee
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
5 changes: 1 addition & 4 deletions core/kernels/bn_table_ops.cc
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,13 @@ class BnStatisticsPushKernel : public AsyncOpKernel {
double* dynamic_double_data = new double[num_elements];
const float* float_data = var_tensor->flat<float>().data();
for (int i = 0; i < num_elements; ++i) {
// std::cout << "float data is: " << float_data[i] << std::endl;
dynamic_double_data[i] = static_cast<double>(float_data[i]);
// std::cout << "double data is: " << dynamic_double_data[i] << std::endl;
}
acc_buf.append_user_data(dynamic_double_data, num_elements * sizeof(double), NoOpDeleter);
// acc_buf.append_user_data(var_tensor->flat<float>().data(), var_tensor->NumElements() * sizeof(float), NoOpDeleter);
allocated_pointers.push_back(dynamic_double_data);
}

BnTable* table = BnTableRegistry::Instance()->Get(table_handle_);
BnTable* table = BnTableRegistry::Instance()->Get(table_handle_);
table->Append(acc_buf, true);

for (auto ptr : allocated_pointers) {
Expand Down
3 changes: 0 additions & 3 deletions core/ps/table/bn_table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ void BnTable::Append(butil::IOBuf& bn_statistics_buf, bool isLocal) {

uint64_t cur_count = static_cast<uint64_t>(total_count_.maxCoeff());

// std::cout << "cur_count is : " << cur_count << std::endl;
// PrintDetail();
// std::cout << "acc_count is : " << acc_count(0) << std::endl;
if(max_count_ > 0 && cur_count > max_count_) {
uint64_t acc_count_num = static_cast<uint64_t>(acc_count.maxCoeff());
double ratio = (double) acc_count_num / cur_count;
Expand Down
7 changes: 3 additions & 4 deletions core/ps/table/bn_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,10 @@ class BnTable {
Eigen::ArrayXd total_squared_sum_;
Eigen::ArrayXd total_squared_sum_err_;
Eigen::ArrayXd total_count_;
Eigen::ArrayXd inc_sum_;
Eigen::ArrayXd inc_squared_sum_;
Eigen::ArrayXd inc_count_;
Eigen::ArrayXd inc_sum_;
Eigen::ArrayXd inc_squared_sum_;
Eigen::ArrayXd inc_count_;
std::unique_ptr<std::mutex> mu_;

};

class BnTableRegistry {
Expand Down

0 comments on commit 1430dee

Please sign in to comment.