未验证 提交 c5c7dc2e 编写于 作者: A Abhinav Arora 提交者: GitHub

Fix CPPLint errors in multiclass_nms, nccl, nce, reduce and save_load_combine (#10032)

* Fix CPPLint errors in multiclass_nms, nccl, nce, reduce and save_load_combine

* Fix
上级 598035f9
...@@ -173,8 +173,8 @@ class MultiClassNMSKernel : public framework::OpKernel<T> { ...@@ -173,8 +173,8 @@ class MultiClassNMSKernel : public framework::OpKernel<T> {
void MultiClassNMS(const framework::ExecutionContext& ctx, void MultiClassNMS(const framework::ExecutionContext& ctx,
const Tensor& scores, const Tensor& bboxes, const Tensor& scores, const Tensor& bboxes,
std::map<int, std::vector<int>>& indices, std::map<int, std::vector<int>>* indices,
int& num_nmsed_out) const { int* num_nmsed_out) const {
int64_t background_label = ctx.Attr<int>("background_label"); int64_t background_label = ctx.Attr<int>("background_label");
int64_t nms_top_k = ctx.Attr<int>("nms_top_k"); int64_t nms_top_k = ctx.Attr<int>("nms_top_k");
int64_t keep_top_k = ctx.Attr<int>("keep_top_k"); int64_t keep_top_k = ctx.Attr<int>("keep_top_k");
...@@ -189,15 +189,15 @@ class MultiClassNMSKernel : public framework::OpKernel<T> { ...@@ -189,15 +189,15 @@ class MultiClassNMSKernel : public framework::OpKernel<T> {
if (c == background_label) continue; if (c == background_label) continue;
Tensor score = scores.Slice(c, c + 1); Tensor score = scores.Slice(c, c + 1);
NMSFast(bboxes, score, score_threshold, nms_threshold, nms_eta, nms_top_k, NMSFast(bboxes, score, score_threshold, nms_threshold, nms_eta, nms_top_k,
&(indices[c])); &((*indices)[c]));
num_det += indices[c].size(); num_det += (*indices)[c].size();
} }
num_nmsed_out = num_det; *num_nmsed_out = num_det;
const T* scores_data = scores.data<T>(); const T* scores_data = scores.data<T>();
if (keep_top_k > -1 && num_det > keep_top_k) { if (keep_top_k > -1 && num_det > keep_top_k) {
std::vector<std::pair<float, std::pair<int, int>>> score_index_pairs; std::vector<std::pair<float, std::pair<int, int>>> score_index_pairs;
for (const auto& it : indices) { for (const auto& it : *indices) {
int label = it.first; int label = it.first;
const T* sdata = scores_data + label * predict_dim; const T* sdata = scores_data + label * predict_dim;
const std::vector<int>& label_indices = it.second; const std::vector<int>& label_indices = it.second;
...@@ -220,13 +220,13 @@ class MultiClassNMSKernel : public framework::OpKernel<T> { ...@@ -220,13 +220,13 @@ class MultiClassNMSKernel : public framework::OpKernel<T> {
int idx = score_index_pairs[j].second.second; int idx = score_index_pairs[j].second.second;
new_indices[label].push_back(idx); new_indices[label].push_back(idx);
} }
new_indices.swap(indices); new_indices.swap(*indices);
num_nmsed_out = keep_top_k; *num_nmsed_out = keep_top_k;
} }
} }
void MultiClassOutput(const Tensor& scores, const Tensor& bboxes, void MultiClassOutput(const Tensor& scores, const Tensor& bboxes,
std::map<int, std::vector<int>>& selected_indices, const std::map<int, std::vector<int>>& selected_indices,
Tensor* outs) const { Tensor* outs) const {
int predict_dim = scores.dims()[1]; int predict_dim = scores.dims()[1];
auto* scores_data = scores.data<T>(); auto* scores_data = scores.data<T>();
...@@ -273,7 +273,7 @@ class MultiClassNMSKernel : public framework::OpKernel<T> { ...@@ -273,7 +273,7 @@ class MultiClassNMSKernel : public framework::OpKernel<T> {
std::map<int, std::vector<int>> indices; std::map<int, std::vector<int>> indices;
int num_nmsed_out = 0; int num_nmsed_out = 0;
MultiClassNMS(ctx, ins_score, ins_boxes, indices, num_nmsed_out); MultiClassNMS(ctx, ins_score, ins_boxes, &indices, &num_nmsed_out);
all_indices.push_back(indices); all_indices.push_back(indices);
batch_starts.push_back(batch_starts.back() + num_nmsed_out); batch_starts.push_back(batch_starts.back() + num_nmsed_out);
} }
......
...@@ -135,8 +135,9 @@ class NCCLBcastKernel : public framework::OpKernel<T> { ...@@ -135,8 +135,9 @@ class NCCLBcastKernel : public framework::OpKernel<T> {
auto* x = ctx.Input<LoDTensor>("X"); auto* x = ctx.Input<LoDTensor>("X");
VLOG(3) << "gpu : " << gpu_id << " invoke Bcast. send " << x->numel(); VLOG(3) << "gpu : " << gpu_id << " invoke Bcast. send " << x->numel();
PADDLE_ENFORCE(platform::dynload::ncclBcast( PADDLE_ENFORCE(platform::dynload::ncclBcast(
(void*)x->data<T>(), x->numel(), NCCLTypeWrapper<T>::type, root, reinterpret_cast<void*>(const_cast<T*>(x->data<T>())), x->numel(),
comm->comms().at(idx), ctx.cuda_device_context().stream())); NCCLTypeWrapper<T>::type, root, comm->comms().at(idx),
ctx.cuda_device_context().stream()));
VLOG(3) << "gpu : " << gpu_id << " finished Bcast."; VLOG(3) << "gpu : " << gpu_id << " finished Bcast.";
} else { } else {
auto* out = ctx.Output<LoDTensor>("Out"); auto* out = ctx.Output<LoDTensor>("Out");
......
...@@ -16,6 +16,7 @@ limitations under the License. */ ...@@ -16,6 +16,7 @@ limitations under the License. */
#include <math.h> #include <math.h>
#include <random> #include <random>
#include <vector>
#include "paddle/fluid/framework/eigen.h" #include "paddle/fluid/framework/eigen.h"
#include "paddle/fluid/framework/op_registry.h" #include "paddle/fluid/framework/op_registry.h"
#include "unsupported/Eigen/CXX11/Tensor" #include "unsupported/Eigen/CXX11/Tensor"
...@@ -108,7 +109,7 @@ class NCEKernel : public framework::OpKernel<T> { ...@@ -108,7 +109,7 @@ class NCEKernel : public framework::OpKernel<T> {
auto weight_mat = EigenMatrix<T>::From(*(context.Input<Tensor>("Weight"))); auto weight_mat = EigenMatrix<T>::From(*(context.Input<Tensor>("Weight")));
for (int64_t i = 0; i < sample_labels->numel(); ++i) { for (int64_t i = 0; i < sample_labels->numel(); ++i) {
Eigen::Tensor<T, 0, Eigen::RowMajor, Eigen::DenseIndex> result = Eigen::Tensor<T, 0, Eigen::RowMajor, Eigen::DenseIndex> result =
(input_mat.chip((int)(i / sample_labels->dims()[1]), 0) * (input_mat.chip(static_cast<int>(i / sample_labels->dims()[1]), 0) *
weight_mat.chip(sample_labels_data[i], 0)) weight_mat.chip(sample_labels_data[i], 0))
.sum(); .sum();
sample_out_data[i] += result(0); sample_out_data[i] += result(0);
...@@ -190,7 +191,7 @@ class NCEGradKernel : public framework::OpKernel<T> { ...@@ -190,7 +191,7 @@ class NCEGradKernel : public framework::OpKernel<T> {
auto x_matrix = EigenMatrix<T>::From(*(context.Input<Tensor>("Input"))); auto x_matrix = EigenMatrix<T>::From(*(context.Input<Tensor>("Input")));
for (int64_t i = 0; i < sample_labels->numel(); ++i) { for (int64_t i = 0; i < sample_labels->numel(); ++i) {
d_w_matrix.chip(sample_labels_data[i], 0) += d_w_matrix.chip(sample_labels_data[i], 0) +=
x_matrix.chip((int)(i / sample_labels->dims()[1]), 0) * x_matrix.chip(static_cast<int>(i / sample_labels->dims()[1]), 0) *
sample_grad_data[i]; sample_grad_data[i];
} }
} }
...@@ -202,7 +203,7 @@ class NCEGradKernel : public framework::OpKernel<T> { ...@@ -202,7 +203,7 @@ class NCEGradKernel : public framework::OpKernel<T> {
auto d_x_matrix = EigenMatrix<T>::From(*d_x); auto d_x_matrix = EigenMatrix<T>::From(*d_x);
auto w_matrix = EigenMatrix<T>::From(*(context.Input<Tensor>("Weight"))); auto w_matrix = EigenMatrix<T>::From(*(context.Input<Tensor>("Weight")));
for (int64_t i = 0; i < sample_labels->numel(); ++i) { for (int64_t i = 0; i < sample_labels->numel(); ++i) {
d_x_matrix.chip((int)(i / sample_labels->dims()[1]), 0) += d_x_matrix.chip(static_cast<int>(i / sample_labels->dims()[1]), 0) +=
w_matrix.chip(sample_labels_data[i], 0) * sample_grad_data[i]; w_matrix.chip(sample_labels_data[i], 0) * sample_grad_data[i];
} }
} }
......
...@@ -35,77 +35,77 @@ using EigenVector = framework::EigenVector<T, MajorType, IndexType>; ...@@ -35,77 +35,77 @@ using EigenVector = framework::EigenVector<T, MajorType, IndexType>;
struct SumFunctor { struct SumFunctor {
template <typename DeviceContext, typename X, typename Y, typename Dim> template <typename DeviceContext, typename X, typename Y, typename Dim>
void operator()(const DeviceContext& place, X& x, Y& y, const Dim& dim) { void operator()(const DeviceContext& place, X* x, Y* y, const Dim& dim) {
y.device(place) = x.sum(dim); y->device(place) = x->sum(dim);
} }
}; };
struct SumGradFunctor { struct SumGradFunctor {
template <typename DeviceContext, typename X, typename Y, typename DX, template <typename DeviceContext, typename X, typename Y, typename DX,
typename DY, typename Dim> typename DY, typename Dim>
void operator()(const DeviceContext& place, X& x, Y& y, DX& dx, DY& dy, void operator()(const DeviceContext& place, X* x, Y* y, DX* dx, DY* dy,
const Dim& dim, int size) { const Dim& dim, int size) {
dx.device(place) = dy.broadcast(dim); dx->device(place) = dy->broadcast(dim);
} }
}; };
struct MeanFunctor { struct MeanFunctor {
template <typename DeviceContext, typename X, typename Y, typename Dim> template <typename DeviceContext, typename X, typename Y, typename Dim>
void operator()(const DeviceContext& place, X& x, Y& y, const Dim& dim) { void operator()(const DeviceContext& place, X* x, Y* y, const Dim& dim) {
y.device(place) = x.mean(dim); y->device(place) = x->mean(dim);
} }
}; };
struct MeanGradFunctor { struct MeanGradFunctor {
template <typename DeviceContext, typename X, typename Y, typename DX, template <typename DeviceContext, typename X, typename Y, typename DX,
typename DY, typename Dim> typename DY, typename Dim>
void operator()(const DeviceContext& place, X& x, Y& y, DX& dx, DY& dy, void operator()(const DeviceContext& place, X* x, Y* y, DX* dx, DY* dy,
const Dim& dim, int size) { const Dim& dim, int size) {
dx.device(place) = dy.broadcast(dim) / dx.constant(size); dx->device(place) = dy->broadcast(dim) / dx->constant(size);
} }
}; };
struct MaxFunctor { struct MaxFunctor {
template <typename DeviceContext, typename X, typename Y, typename Dim> template <typename DeviceContext, typename X, typename Y, typename Dim>
void operator()(const DeviceContext& place, X& x, Y& y, const Dim& dim) { void operator()(const DeviceContext& place, X* x, Y* y, const Dim& dim) {
y.device(place) = x.maximum(dim); y->device(place) = x->maximum(dim);
} }
}; };
struct MinFunctor { struct MinFunctor {
template <typename DeviceContext, typename X, typename Y, typename Dim> template <typename DeviceContext, typename X, typename Y, typename Dim>
void operator()(const DeviceContext& place, X& x, Y& y, const Dim& dim) { void operator()(const DeviceContext& place, X* x, Y* y, const Dim& dim) {
y.device(place) = x.minimum(dim); y->device(place) = x->minimum(dim);
} }
}; };
struct MaxOrMinGradFunctor { struct MaxOrMinGradFunctor {
template <typename DeviceContext, typename X, typename Y, typename DX, template <typename DeviceContext, typename X, typename Y, typename DX,
typename DY, typename Dim> typename DY, typename Dim>
void operator()(const DeviceContext& place, X& x, Y& y, DX& dx, DY& dy, void operator()(const DeviceContext& place, X* x, Y* y, DX* dx, DY* dy,
const Dim& dim, int size) { const Dim& dim, int size) {
auto equals = x == y.broadcast(dim); auto equals = (*x) == y->broadcast(dim);
auto ones = dx.constant(1); auto ones = dx->constant(1);
auto zeros = dx.constant(0); auto zeros = dx->constant(0);
// If there are multiple minimum or maximum elements, the subgradient of // If there are multiple minimum or maximum elements, the subgradient of
// each is the set [0, 1], and we pass gradient to all of them here. // each is the set [0, 1], and we pass gradient to all of them here.
dx.device(place) = dy.broadcast(dim) * equals.select(ones, zeros); dx->device(place) = dy->broadcast(dim) * equals.select(ones, zeros);
} }
}; };
struct ProdFunctor { struct ProdFunctor {
template <typename DeviceContext, typename X, typename Y, typename Dim> template <typename DeviceContext, typename X, typename Y, typename Dim>
void operator()(const DeviceContext& place, X& x, Y& y, const Dim& dim) { void operator()(const DeviceContext& place, X* x, Y* y, const Dim& dim) {
y.device(place) = x.prod(dim); y->device(place) = x->prod(dim);
} }
}; };
struct ProdGradFunctor { struct ProdGradFunctor {
template <typename DeviceContext, typename X, typename Y, typename DX, template <typename DeviceContext, typename X, typename Y, typename DX,
typename DY, typename Dim> typename DY, typename Dim>
void operator()(const DeviceContext& place, X& x, Y& y, DX& dx, DY& dy, void operator()(const DeviceContext& place, X* x, Y* y, DX* dx, DY* dy,
const Dim& dim, int size) { const Dim& dim, int size) {
dx.device(place) = dy.broadcast(dim) * y.broadcast(dim) * x.inverse(); dx->device(place) = dy->broadcast(dim) * y->broadcast(dim) * x->inverse();
} }
}; };
...@@ -125,7 +125,7 @@ class ReduceKernel : public framework::OpKernel<T> { ...@@ -125,7 +125,7 @@ class ReduceKernel : public framework::OpKernel<T> {
*context.template device_context<DeviceContext>().eigen_device(); *context.template device_context<DeviceContext>().eigen_device();
auto reduce_dim = Eigen::array<int, 1>({{0}}); auto reduce_dim = Eigen::array<int, 1>({{0}});
Functor functor; Functor functor;
functor(place, x, out, reduce_dim); functor(place, &x, &out, reduce_dim);
} else { } else {
int rank = context.Input<Tensor>("X")->dims().size(); int rank = context.Input<Tensor>("X")->dims().size();
switch (rank) { switch (rank) {
...@@ -178,10 +178,10 @@ class ReduceKernel : public framework::OpKernel<T> { ...@@ -178,10 +178,10 @@ class ReduceKernel : public framework::OpKernel<T> {
if (D == 1) { if (D == 1) {
auto out = EigenScalar<T>::From(*output); auto out = EigenScalar<T>::From(*output);
functor(place, x, out, reduce_dim); functor(place, &x, &out, reduce_dim);
} else { } else {
auto out = EigenTensor<T, (D - 1)>::From(*output, dims); auto out = EigenTensor<T, (D - 1)>::From(*output, dims);
functor(place, x, out, reduce_dim); functor(place, &x, &out, reduce_dim);
} }
} }
}; };
...@@ -206,7 +206,7 @@ class ReduceGradKernel : public framework::OpKernel<T> { ...@@ -206,7 +206,7 @@ class ReduceGradKernel : public framework::OpKernel<T> {
auto broadcast_dim = auto broadcast_dim =
Eigen::array<int, 1>({{static_cast<int>(input0->numel())}}); Eigen::array<int, 1>({{static_cast<int>(input0->numel())}});
Functor functor; Functor functor;
functor(place, x, x_reduce, x_grad, x_reduce_grad, broadcast_dim, functor(place, &x, &x_reduce, &x_grad, &x_reduce_grad, broadcast_dim,
broadcast_dim[0]); broadcast_dim[0]);
} else { } else {
int rank = context.Input<Tensor>("X")->dims().size(); int rank = context.Input<Tensor>("X")->dims().size();
...@@ -258,7 +258,7 @@ class ReduceGradKernel : public framework::OpKernel<T> { ...@@ -258,7 +258,7 @@ class ReduceGradKernel : public framework::OpKernel<T> {
auto& place = auto& place =
*context.template device_context<DeviceContext>().eigen_device(); *context.template device_context<DeviceContext>().eigen_device();
Functor functor; Functor functor;
functor(place, x, x_reduce, x_grad, x_reduce_grad, broadcast_dim, functor(place, &x, &x_reduce, &x_grad, &x_reduce_grad, broadcast_dim,
broadcast_dim[dim]); broadcast_dim[dim]);
} }
}; };
......
...@@ -23,17 +23,17 @@ USE_NO_KERNEL_OP(load_combine); ...@@ -23,17 +23,17 @@ USE_NO_KERNEL_OP(load_combine);
int* CreateForSaveCombineOp(int x, int y, const std::vector<int>& lod_info, int* CreateForSaveCombineOp(int x, int y, const std::vector<int>& lod_info,
std::string var_name, std::string var_name,
paddle::platform::CPUPlace& place, const paddle::platform::CPUPlace& place,
paddle::framework::Scope& scope, paddle::framework::Scope* scope,
paddle::framework::LoD& expect_lod) { paddle::framework::LoD* expect_lod) {
auto var = scope.Var(var_name); auto var = scope->Var(var_name);
auto tensor = var->GetMutable<paddle::framework::LoDTensor>(); auto tensor = var->GetMutable<paddle::framework::LoDTensor>();
tensor->Resize({x, y}); tensor->Resize({x, y});
expect_lod.resize(1); expect_lod->resize(1);
for (size_t i = 0; i < lod_info.size(); i++) { for (size_t i = 0; i < lod_info.size(); i++) {
expect_lod[0].push_back(lod_info[i]); (*expect_lod)[0].push_back(lod_info[i]);
} }
tensor->set_lod(expect_lod); tensor->set_lod(*expect_lod);
int* expect = tensor->mutable_data<int>(place); int* expect = tensor->mutable_data<int>(place);
for (int64_t i = 0; i < tensor->numel(); ++i) { for (int64_t i = 0; i < tensor->numel(); ++i) {
expect[i] = static_cast<int>(i); expect[i] = static_cast<int>(i);
...@@ -42,17 +42,17 @@ int* CreateForSaveCombineOp(int x, int y, const std::vector<int>& lod_info, ...@@ -42,17 +42,17 @@ int* CreateForSaveCombineOp(int x, int y, const std::vector<int>& lod_info,
} }
paddle::framework::LoDTensor* GeneratePlaceholderBeforeLoad( paddle::framework::LoDTensor* GeneratePlaceholderBeforeLoad(
const std::string out_var_name, paddle::framework::Scope& scope) { const std::string out_var_name, paddle::framework::Scope* scope) {
auto load_var = scope.Var(out_var_name); auto load_var = scope->Var(out_var_name);
auto target = load_var->GetMutable<paddle::framework::LoDTensor>(); auto target = load_var->GetMutable<paddle::framework::LoDTensor>();
return target; return target;
} }
int* GetValuesAfterLoadCombineOp(paddle::framework::LoDTensor* target, int* GetValuesAfterLoadCombineOp(paddle::framework::LoDTensor* target,
paddle::framework::Scope& scope, const paddle::framework::Scope& scope,
paddle::framework::LoD& actual_lod) { paddle::framework::LoD* actual_lod) {
int* actual = target->data<int>(); int* actual = target->data<int>();
actual_lod = target->lod(); *actual_lod = target->lod();
return actual; return actual;
} }
...@@ -78,26 +78,26 @@ TEST(SaveLoadCombineOp, CPU) { ...@@ -78,26 +78,26 @@ TEST(SaveLoadCombineOp, CPU) {
std::vector<int> lod1 = {0, 1, 2, 3, 10}; std::vector<int> lod1 = {0, 1, 2, 3, 10};
int numel1 = 100; int numel1 = 100;
paddle::framework::LoD expect_lod1; paddle::framework::LoD expect_lod1;
int* expect1 = CreateForSaveCombineOp(10, 10, lod1, "test_var1", place, scope, int* expect1 = CreateForSaveCombineOp(10, 10, lod1, "test_var1", place,
expect_lod1); &scope, &expect_lod1);
std::vector<int> lod2 = {0, 2, 5, 10}; std::vector<int> lod2 = {0, 2, 5, 10};
int numel2 = 200; int numel2 = 200;
paddle::framework::LoD expect_lod2; paddle::framework::LoD expect_lod2;
int* expect2 = CreateForSaveCombineOp(10, 20, lod2, "test_var2", place, scope, int* expect2 = CreateForSaveCombineOp(10, 20, lod2, "test_var2", place,
expect_lod2); &scope, &expect_lod2);
std::vector<int> lod3 = {0, 2, 3, 20}; std::vector<int> lod3 = {0, 2, 3, 20};
int numel3 = 4000; int numel3 = 4000;
paddle::framework::LoD expect_lod3; paddle::framework::LoD expect_lod3;
int* expect3 = CreateForSaveCombineOp(20, 200, lod3, "test_var3", place, int* expect3 = CreateForSaveCombineOp(20, 200, lod3, "test_var3", place,
scope, expect_lod3); &scope, &expect_lod3);
std::vector<int> lod4 = {0, 1, 20}; std::vector<int> lod4 = {0, 1, 20};
int numel4 = 1000; int numel4 = 1000;
paddle::framework::LoD expect_lod4; paddle::framework::LoD expect_lod4;
int* expect4 = CreateForSaveCombineOp(20, 50, lod4, "test_var4", place, scope, int* expect4 = CreateForSaveCombineOp(20, 50, lod4, "test_var4", place,
expect_lod4); &scope, &expect_lod4);
// Set attributes // Set attributes
std::string filename = "check_tensor.ls"; std::string filename = "check_tensor.ls";
...@@ -111,10 +111,10 @@ TEST(SaveLoadCombineOp, CPU) { ...@@ -111,10 +111,10 @@ TEST(SaveLoadCombineOp, CPU) {
save_combine_op->Run(scope, place); save_combine_op->Run(scope, place);
// Set up output vars // Set up output vars
auto target1 = GeneratePlaceholderBeforeLoad("out_var1", scope); auto target1 = GeneratePlaceholderBeforeLoad("out_var1", &scope);
auto target2 = GeneratePlaceholderBeforeLoad("out_var2", scope); auto target2 = GeneratePlaceholderBeforeLoad("out_var2", &scope);
auto target3 = GeneratePlaceholderBeforeLoad("out_var3", scope); auto target3 = GeneratePlaceholderBeforeLoad("out_var3", &scope);
auto target4 = GeneratePlaceholderBeforeLoad("out_var4", scope); auto target4 = GeneratePlaceholderBeforeLoad("out_var4", &scope);
// Run the load_combine_op // Run the load_combine_op
auto load_combine_op = paddle::framework::OpRegistry::CreateOp( auto load_combine_op = paddle::framework::OpRegistry::CreateOp(
...@@ -123,10 +123,10 @@ TEST(SaveLoadCombineOp, CPU) { ...@@ -123,10 +123,10 @@ TEST(SaveLoadCombineOp, CPU) {
load_combine_op->Run(scope, place); load_combine_op->Run(scope, place);
paddle::framework::LoD actual_lod1, actual_lod2, actual_lod3, actual_lod4; paddle::framework::LoD actual_lod1, actual_lod2, actual_lod3, actual_lod4;
int* actual1 = GetValuesAfterLoadCombineOp(target1, scope, actual_lod1); int* actual1 = GetValuesAfterLoadCombineOp(target1, scope, &actual_lod1);
int* actual2 = GetValuesAfterLoadCombineOp(target2, scope, actual_lod2); int* actual2 = GetValuesAfterLoadCombineOp(target2, scope, &actual_lod2);
int* actual3 = GetValuesAfterLoadCombineOp(target3, scope, actual_lod3); int* actual3 = GetValuesAfterLoadCombineOp(target3, scope, &actual_lod3);
int* actual4 = GetValuesAfterLoadCombineOp(target4, scope, actual_lod4); int* actual4 = GetValuesAfterLoadCombineOp(target4, scope, &actual_lod4);
CheckValues(expect1, actual1, expect_lod1, actual_lod1, numel1); CheckValues(expect1, actual1, expect_lod1, actual_lod1, numel1);
CheckValues(expect2, actual2, expect_lod2, actual_lod2, numel2); CheckValues(expect2, actual2, expect_lod2, actual_lod2, numel2);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册