Skip to content

Conversation

@SigureMo
Copy link
Member

@SigureMo SigureMo commented Nov 7, 2025

PR Category

Execute Infrastructure

PR Types

Improvements

Description

补全 at::Tensor 构造函数接口,避免移动构造和拷贝构造触发默认的浅拷贝

@SigureMo SigureMo requested a review from Copilot November 7, 2025 12:40
@paddle-bot
Copy link

paddle-bot bot commented Nov 7, 2025

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request implements copy/move semantics for ATen compatibility layer tensor classes and updates the mutable_data_ptr implementation to use the correct API. The changes improve the API compatibility with PyTorch's ATen library by removing TODO placeholders and implementing standard C++ special member functions.

  • Implements copy and move constructors/assignment operators for Tensor and TensorBase classes
  • Changes mutable_data_ptr() to call data<T>() instead of mutable_data<T>()
  • Removes unused EmptyTensor.h include and adds Utils.h include to main ATen header

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
paddle/phi/api/include/compat/ATen/core/TensorMethods.cpp Updates mutable_data_ptr() to use data<T>() API
paddle/phi/api/include/compat/ATen/core/TensorBody.h Implements copy/move constructors and assignment operators for Tensor class
paddle/phi/api/include/compat/ATen/core/TensorBase.h Adds special member functions (copy/move constructors, destructor, assignment operators) to TensorBase
paddle/phi/api/include/compat/ATen/Utils.h Removes unused EmptyTensor.h include
paddle/phi/api/include/compat/ATen/ATen.h Adds Utils.h include to main header

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

SigureMo and others added 2 commits November 7, 2025 20:52
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@SigureMo SigureMo requested a review from Copilot November 7, 2025 13:00
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@SigureMo SigureMo changed the title [Compat] Add more constructors for compatible at::Tensor [Compat][3.14] Add more constructors for compatible at::Tensor Nov 7, 2025
@SigureMo SigureMo requested a review from gouzil November 7, 2025 15:42
@SigureMo SigureMo changed the title [Compat][3.14] Add more constructors for compatible at::Tensor [Compat] Add more constructors for compatible at::Tensor Nov 8, 2025
@SigureMo SigureMo merged commit 21d46fd into PaddlePaddle:develop Nov 10, 2025
55 of 57 checks passed
@SigureMo SigureMo deleted the compat/add-more-constructor-for-tensor branch November 10, 2025 02:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants