Skip to content

Commit 043128a

Browse files
committed
fix ut
1 parent 9cf6992 commit 043128a

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

paddle/phi/api/include/torch_compat_runtime.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class ArrayRef {
8585
: std::begin(Vec)),
8686
Length(Vec.size()) {}
8787

88-
const paddle::IntArray& _PD_ToPaddleIntArray() const {
88+
const paddle::IntArray _PD_ToPaddleIntArray() const {
8989
return paddle::IntArray(Data, Length);
9090
}
9191
};
@@ -273,18 +273,28 @@ using Dtype = at::ScalarType;
273273

274274
void compiling_test() {
275275
// Example usage of the Tensor class
276+
std::cout << "111111";
276277
at::Tensor a = at::ones({2, 3}, at::TensorOptions());
278+
std::cout << "222222";
277279
at::Tensor b = at::full({2, 3}, 1, at::ScalarType::Float);
280+
std::cout << "333333";
278281
double c = 10;
279282
at::Tensor a_contig = a.contiguous();
283+
std::cout << "444444";
280284
at::Tensor b_contig = b.contiguous();
285+
std::cout << "555555";
281286
at::Tensor result = at::empty(a_contig.sizes(), a_contig.options());
287+
std::cout << "666666";
282288
const float* a_ptr = a_contig.data_ptr<float>();
289+
std::cout << "777777";
283290
const float* b_ptr = b_contig.data_ptr<float>();
291+
std::cout << "888888";
284292
float* result_ptr = result.data_ptr<float>();
293+
std::cout << "999999";
285294
for (int64_t i = 0; i < a_contig.numel(); i++) {
286295
result_ptr[i] = a_ptr[i] * b_ptr[i] + c;
287296
}
297+
std::cout << "000000";
288298
// Show result
289299
for (int64_t i = 0; i < a_contig.numel(); i++) {
290300
std::cout << "Result[" << i << "] = " << a_ptr[i] * b_ptr[i] + c

test/cpp/conversion/conversion_basic_test.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include "gtest/gtest.h"
1818

1919
TEST(conversion_basic_test, BasicCase) {
20-
// Example usage of the Tensor class
2120
at::Tensor a = at::ones({2, 3}, at::TensorOptions());
2221
at::Tensor b = at::full({2, 3}, 2, at::ScalarType::Float);
2322
double c = 10;

0 commit comments

Comments
 (0)