Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ci/static_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ aten_ops_signature_inputs=$(
if [ -n "${aten_ops_signature_inputs}" ]; then
aten_ops_signature_torch_target=$(mktemp -d)
pip install --target "${aten_ops_signature_torch_target}" \
torch==2.12.1 --index-url https://download.pytorch.org/whl/cpu 1>nul
torch==2.13.0 --index-url https://download.pytorch.org/whl/cpu 1>nul
Comment on lines 205 to +206

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3 优先级:P3

1>nul 在 Linux bash 下会把 stdout 重定向到当前目录的字面文件 nul,不会丢弃输出;这条 static check 路径触发后可能在 workspace 留下多余文件,并且和脚本里其他 /dev/null 用法不一致。请改成 /dev/null

处理要求:请针对该评论进行回复(同意并已修改请回复 Done,不同意请说明理由)。

Suggested change
torch==2.13.0 --index-url https://download.pytorch.org/whl/cpu 1>nul
torch==2.13.0 --index-url https://download.pytorch.org/whl/cpu 1>/dev/null


PYTHONPATH="${aten_ops_signature_torch_target}${PYTHONPATH:+:${PYTHONPATH}}" \
python ${PADDLE_ROOT}/tools/check_aten_ops_signature.py \
Expand Down
1 change: 0 additions & 1 deletion paddle/phi/api/include/compat/ATen/Functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
#include <ATen/ops/permute.h>
#include <ATen/ops/reciprocal.h>
#include <ATen/ops/record_stream.h>
#include <ATen/ops/rename.h>
#include <ATen/ops/reshape.h>
#include <ATen/ops/resize.h>
#include <ATen/ops/select.h>
Expand Down
6 changes: 0 additions & 6 deletions paddle/phi/api/include/compat/ATen/core/TensorBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,12 +259,6 @@ class PADDLE_API TensorBase {
return compat::_PD_PhiDataTypeToAtenScalarType(tensor_.dtype());
}

bool has_names() const {
// In PyTorch, has_names() is used to check if any dimension has names.
// In Paddle, we don't support named dimension yet, so always return false.
return false;
}

TensorOptions options() const {
return TensorOptions().dtype(dtype()).device(device()).layout(layout());
}
Expand Down
3 changes: 0 additions & 3 deletions paddle/phi/api/include/compat/ATen/core/TensorBody.h
Original file line number Diff line number Diff line change
Expand Up @@ -791,9 +791,6 @@ class Tensor : public TensorBase {
// chunk - splits tensor into chunks
std::vector<Tensor> chunk(int64_t chunks, int64_t dim = 0) const;

// rename - stub for Paddle (Dimname not supported)
Tensor rename(::std::optional<at::DimnameList> names) const;

// new_empty - creates uninitialized tensor with same dtype/device
Tensor new_empty(at::IntArrayRef size, at::TensorOptions options = {}) const;
Tensor new_empty(at::IntArrayRef size,
Expand Down
26 changes: 0 additions & 26 deletions paddle/phi/api/include/compat/ATen/ops/rename.h

This file was deleted.

2 changes: 0 additions & 2 deletions test/cpp/compat/ATen_basic_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,6 @@ TEST(TensorBaseTest, UndefinedAndNonDenseBranchCoverage) {
at::TensorBase undefined;
ASSERT_EQ(undefined.toString(), std::string("UndefinedType"));
ASSERT_EQ(undefined.data_ptr(), nullptr);
ASSERT_FALSE(undefined.has_names());

at::Tensor non_dense = at::arange(6, at::TensorOptions().dtype(at::kFloat))
.as_strided({2, 2}, {4, 1});
ASSERT_FALSE(non_dense.is_non_overlapping_and_dense());
Expand Down
56 changes: 0 additions & 56 deletions test/cpp/compat/ATen_rename_test.cc

This file was deleted.

1 change: 0 additions & 1 deletion test/cpp/compat/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ cc_test(ATen_item_test SRCS ATen_item_test.cc)
cc_test(ATen_narrow_test SRCS ATen_narrow_test.cc)
cc_test(ATen_new_test SRCS ATen_new_test.cc)
cc_test(ATen_nnz_test SRCS ATen_nnz_test.cc)
cc_test(ATen_rename_test SRCS ATen_rename_test.cc)
cc_test(ATen_reshape_test SRCS ATen_reshape_test.cc)
cc_test(ATen_resize_test SRCS ATen_resize_test.cc)
cc_test(ATen_resize_custom_kernel_test SRCS ATen_resize_custom_kernel_test.cc)
Expand Down
2 changes: 1 addition & 1 deletion tools/check_aten_ops_signature.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
ATEN_TENSOR_BODY = Path("paddle/phi/api/include/compat/ATen/core/TensorBody.h")
ATEN_TENSOR_BASE = Path("paddle/phi/api/include/compat/ATen/core/TensorBase.h")
TORCH_INSTALL_HINT = (
"pip install torch==2.12.1 --index-url https://download.pytorch.org/whl/cpu"
"pip install torch==2.13.0 --index-url https://download.pytorch.org/whl/cpu"
)

BUILTIN_TYPE_WORDS = {
Expand Down
Loading